| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace ghs\controllers;
- use bizGhs\custom\classes\CustomClass;
- use bizGhs\custom\services\CustomService;
- use common\components\stringUtil;
- use common\components\util;
- use Yii;
- use yii\web\Controller;
- class CustomController extends BaseController
- {
- //客户列表 shish 2021.7.8
- public function actionList()
- {
- $get = Yii::$app->request->get();
- $type = isset($get['type']) ? $get['type'] : -1;
- $name = isset($get['name']) ? $get['name'] : '';
- $where = ['ghsId' => $this->ghsId];
- switch ($type) {
- case 1:
- //已开店
- $where['isOpen'] = 1;
- break;
- default:
- }
- if (!empty($name)) {
- if (stringUtil::isMobile($name)) {
- $where['mobile'] = $name;
- } else {
- $where['shopName'] = ['like', $name];
- }
- }
- $list = CustomService::getCustomList($where);
- util::success($list);
- }
- //客户详情 shish 2021.1.8
- public function actionDetail()
- {
- $get = Yii::$app->request->get();
- $shopId = isset($get['shopId']) ? $get['shopId'] : -1;
- $ghsId = $this->ghsId;
- $info = CustomService::getFullInfo($ghsId, $shopId);
- util::success($info);
- }
- //允许月结开关 shish 2021.1.8
- public function actionDebt()
- {
- $get = Yii::$app->request->get();
- $debt = isset($get['debt']) ? $get['debt'] : 0;
- $customId = isset($get['customId']) ? $get['customId'] : 0;
- $custom = CustomClass::getById($customId);
- CustomClass::valid($custom, $this->ghsId);
- CustomClass::debt($custom, $debt);
- util::complete();
- }
- }
|