MUser.Class.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * 用户管理Model
  4. * Created by PhpStorm.
  5. * User: 小威
  6. * Date: 2020/03/28
  7. * Time: 14:33
  8. */
  9. namespace JinDouYun\Model\Manage;
  10. use Exception;
  11. use Mall\Framework\Core\ErrorCode;
  12. use Mall\Framework\Core\StatusCode;
  13. use Mall\Framework\Core\ResultWrapper;
  14. use JinDouYun\Dao\UserCenter\DUserCenter;
  15. use JinDouYun\Dao\Enterprise\DUserBindEnterprise;
  16. class MUser
  17. {
  18. protected $objDUser;
  19. protected $objDUserBindEnterprise;
  20. public function __construct()
  21. {
  22. $this->objDUser = new DUserCenter('default');
  23. $this->objDUserBindEnterprise = new DUserBindEnterprise('default');
  24. }
  25. /**
  26. * 用户列表
  27. * @param $params
  28. * @return ResultWrapper
  29. */
  30. public function getAllUser($params)
  31. {
  32. $where = ['isCustomer' => StatusCode::$customerType['user']];
  33. $dbResult = $this->objDUser->select($where, 'id,mobile,deleteStatus', 'id desc', $params['limit'] , $params['offset']);
  34. if($dbResult === false){
  35. return ResultWrapper::fail($this->objDUser->error(), ErrorCode::$dberror);
  36. }
  37. $total = $this->objDUser->count($where);
  38. $returnDta = [
  39. 'total' => $total ? $total : 0,
  40. 'data' => $dbResult,
  41. ];
  42. return ResultWrapper::success($returnDta);
  43. }
  44. }