| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace ghs\controllers;
- use biz\sj\classes\SjClass;
- use bizHd\saas\classes\ApplyClass;
- use bizHd\saas\services\ApplyService;
- use bizGhs\custom\classes\CustomClass;
- use bizGhs\custom\services\CustomService;
- use common\components\stringUtil;
- use common\components\util;
- use Yii;
- class CustomController extends BaseController
- {
- //客户列表 ssh 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 = ['ownShopId' => $this->shopId];
- switch ($type) {
- case 1:
- //已开店
- $where['isOpen'] = 1;
- break;
- default:
- }
- if (!empty($name)) {
- if (stringUtil::isMobile($name)) {
- $where['mobile'] = $name;
- } else {
- $where['name'] = ['like', $name];
- }
- }
- $list = CustomService::getCustomList($where);
- util::success($list);
- }
- //客户详情 ssh 2021.1.8
- public function actionDetail()
- {
- $get = Yii::$app->request->get();
- $customId = $get['id'] ?? 0;
- $info = CustomService::getCustomInfo($customId);
- CustomClass::valid($info, $this->shopId);
- util::success($info);
- }
- //允许月结开关 ssh 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->shopId);
- CustomClass::debt($custom, $debt);
- util::complete();
- }
- //欠款客户 ssh 2021.2.4
- public function actionDebtList()
- {
- $get = Yii::$app->request->get();
- $where = ['ownShopId' => $this->shopId, 'isDebt' => 1];
- if (isset($get['name']) && !empty($get['name'])) {
- $where['name'] = ['like', $get['name']];
- }
- $list = CustomService::getDebtList($where);
- //共X个客户,合计欠款XXX元
- $shop = $this->shop;
- $list['customNum'] = $shop->mayGatheringNum ?? 0;
- $list['debtAmount'] = $shop->mayGathering ?? 0.00;
- util::success($list);
- }
- }
|