| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace app\common\model;
- class AuthGroupModel extends BaseModel
- {
- protected $table = 'erp_auth_group';
- protected function genSchema(array $schema)
- {
- // TODO: Implement genSchema() method.
- }
- public function findByPaginate(array $params) {
- $where = [
- ['is_delete', '=', 0]
- ];
- return $this->where($where)->order('create_time','desc')->paginate(['list_rows'=>10, "query" => $params]);
- }
- /**
- * @return AuthGroupModel[]|array|\think\Collection
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function fetchAllGroups() {
- return $this->where('is_delete',0)->select();
- }
- public function fetchByDepartmentId($d_id) {
- return $this->where([
- ['is_delete', '=', 0],
- ['department_id', '=', $d_id]
- ])->select();
- }
- }
|