| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- namespace ghs\controllers;
- use biz\saas\classes\ApplyClass;
- use biz\saas\services\ApplyService;
- 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'] : 0;
- $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();
- $customId = $get['id'] ?? 0;
- $info = CustomService::getCustomInfo($customId);
- CustomClass::valid($info, $this->ghsId);
- 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();
- }
-
- //添加新客户 shish 2021.1.8
- public function actionAdd()
- {
- $post = Yii::$app->request->post();
- ApplyService::addCustom($post, $this->ghsId);
- util::complete('已提交审核');
- }
-
- }
|