|
|
@@ -691,4 +691,28 @@ class CustomController extends BaseController
|
|
|
$list = CustomService::getCustomList($where, $sort);
|
|
|
util::success($list);
|
|
|
}
|
|
|
+
|
|
|
+ //删除客户 ssh 20250923
|
|
|
+ public function actionDelCustom()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $id = $get['id'] ?? 0;
|
|
|
+ $custom = CustomClass::getById($id, true);
|
|
|
+ if (empty($custom)) {
|
|
|
+ util::fail('没有找到客户');
|
|
|
+ }
|
|
|
+ if ($custom->shopId != $this->shopId) {
|
|
|
+ util::fail('不是你的客户');
|
|
|
+ }
|
|
|
+ $hdId = $custom->hdId ?? 0;
|
|
|
+ $hd = HdClass::getById($hdId, true);
|
|
|
+ if (empty($hd)) {
|
|
|
+ util::fail('客户信息缺失');
|
|
|
+ }
|
|
|
+ $custom->delStatus = 1;
|
|
|
+ $custom->save();
|
|
|
+ $hd->delStatus = 1;
|
|
|
+ $hd->save();
|
|
|
+ util::complete('删除成功');
|
|
|
+ }
|
|
|
}
|