UserModel.php 770 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\common\model;
  3. class UserModel extends BaseModel
  4. {
  5. protected $table = 'erp_user';
  6. protected function genSchema(array $schema)
  7. {
  8. // TODO: Implement genSchema() method.
  9. }
  10. public function doesItExist($mobile) {
  11. return $this->where([
  12. ["mobile", '=', $mobile],
  13. ["is_delete", '=', 0]
  14. ])->find();
  15. }
  16. public function findByPaginate(array $params) {
  17. $where = [
  18. ['is_delete', '=', 0]
  19. ];
  20. if(!is_null($params['store_id']) && $params['store_id'] > 0)
  21. array_push($where, ['store_id', '=', $params['store_id']]);
  22. return $this->where($where)->order('create_time','desc')->paginate(['list_rows'=>10, "query" => $params]);
  23. }
  24. }