1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace app\common\model;
- class Role extends Base
- {
-
- public static function getList($keyword = "", $valid = -1, $listRow = 20, $field = "*")
- {
- $where = [];
- if ($keyword) {
- $where[] = ["name", "like", "%" . $keyword . "%"];
- }
- if ($valid != -1) {
- $where[] = ["valid", "=", $valid];
- }
- $list = Role::field($field)->where($where)->paginate($listRow);
- return returnFormat(0, '', $list);
- }
- public function getCodesAttr($value, $data)
- {
- return explode(',', $data['codes']);
- }
- }
|