|
|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace ghs\controllers;
|
|
|
|
|
|
+use biz\admin\classes\AdminRoleClass;
|
|
|
use biz\sj\classes\SjClass;
|
|
|
use bizGhs\custom\classes\CustomClass;
|
|
|
use bizGhs\custom\services\CustomService;
|
|
|
@@ -25,6 +26,7 @@ class CustomController extends BaseController
|
|
|
$mobile = $post['mobile'] ?? '';
|
|
|
$confirmMobile = $post['confirmMobile'];
|
|
|
$address = $post['address'] ?? '';
|
|
|
+
|
|
|
if (stringUtil::isMobile($mobile) == false) {
|
|
|
util::fail(' 请填写正确的手机号');
|
|
|
}
|
|
|
@@ -89,6 +91,13 @@ class CustomController extends BaseController
|
|
|
}
|
|
|
$custom = CustomClass::build($this->shopId, $hdShopId);
|
|
|
$custom['avatar'] = imgUtil::groupImg($custom['avatar']);
|
|
|
+
|
|
|
+ //客户欠款额度设置
|
|
|
+ if (isset($post['debtLimit']) && is_numeric($post['debtLimit'])) {
|
|
|
+ $customId = $custom['id'] ?? 0;
|
|
|
+ CustomClass::updateById($customId, ['debtLimit' => $post['debtLimit']]);
|
|
|
+ }
|
|
|
+
|
|
|
$transaction->commit();
|
|
|
util::success($custom);
|
|
|
} catch (\Exception $exception) {
|
|
|
@@ -168,4 +177,28 @@ class CustomController extends BaseController
|
|
|
util::success($list);
|
|
|
}
|
|
|
|
|
|
+ //修改欠款额度 shish 20210625
|
|
|
+ public function actionUpdateDebtLimit()
|
|
|
+ {
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ $roleId = $shopAdmin['roleId'] ?? 0;
|
|
|
+ $role = AdminRoleClass::getById($roleId);
|
|
|
+ $roleName = $role['roleName'] ?? '';
|
|
|
+ if ($roleName == '员工') {
|
|
|
+ util::fail('您没有权限操作哦');
|
|
|
+ }
|
|
|
+
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $id = $get['id'] ?? 0;
|
|
|
+ $debtLimit = $get['debtLimit'] ?? 0;
|
|
|
+ if (is_numeric($debtLimit) == false || $debtLimit <= 0) {
|
|
|
+ util::fail('请填写金额');
|
|
|
+ }
|
|
|
+ $custom = CustomClass::getById($id, true);
|
|
|
+ CustomClass::valid($custom, $this->shopId);
|
|
|
+ $custom->debtLimit = $debtLimit;
|
|
|
+ $custom->save();
|
|
|
+ util::complete();
|
|
|
+ }
|
|
|
+
|
|
|
}
|