UserController.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace saas\controllers;
  3. use biz\merchant\services\MerchantAssetService;
  4. use biz\retail\services\RetailAssetService;
  5. use biz\user\services\UserService;
  6. use common\components\util;
  7. use Yii;
  8. class UserController extends BaseController
  9. {
  10. public function actionList()
  11. {
  12. $get = Yii::$app->request->get();
  13. $type = isset($get['type']) ? $get['type'] : -1;
  14. $where = [];
  15. switch ($type) {
  16. case 1:
  17. //粉丝
  18. $where['subscribe'] = 1;
  19. break;
  20. case 2:
  21. //会员
  22. $where['isMember'] = 1;
  23. break;
  24. default:
  25. }
  26. $list = UserService::getUserList($where);
  27. $asset = RetailAssetService::getAsset();
  28. $list['asset'] = $asset;
  29. util::success($list);
  30. }
  31. //客户列表 shish 2019.11.30
  32. public function actionOaList()
  33. {
  34. $get = Yii::$app->request->get();
  35. $type = isset($get['type']) ? $get['type'] : -1;
  36. $merchantId = 12358;
  37. $where = ['merchantId' => $merchantId];
  38. switch ($type) {
  39. case 1:
  40. //粉丝
  41. $where['subscribe'] = 1;
  42. break;
  43. case 2:
  44. //会员
  45. $where['isMember'] = 1;
  46. break;
  47. default:
  48. }
  49. $list = UserService::getUserList($where);
  50. $merchantAsset = MerchantAssetService::getByMerchantId($merchantId);
  51. $list['asset'] = $merchantAsset;
  52. util::success($list);
  53. }
  54. }