| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace app\common\model;
- class UserModel extends BaseModel
- {
- protected $table = 'erp_user';
- protected function genSchema(array $schema)
- {
- // TODO: Implement genSchema() method.
- }
- public function doesItExist($mobile) {
- return $this->where([
- ["mobile", '=', $mobile],
- ["is_delete", '=', 0]
- ])->find();
- }
- public function findByPaginate(array $params) {
- $where = [
- ['is_delete', '=', 0]
- ];
- if(!is_null($params['store_id']) && $params['store_id'] > 0)
- array_push($where, ['store_id', '=', $params['store_id']]);
- return $this->where($where)
- ->order('create_time','desc')
- ->paginate(['list_rows'=> 10, "query" => $params]);
- }
- }
|