|
|
@@ -835,6 +835,9 @@ class CustomController extends BaseController
|
|
|
util::complete();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 上门最低消费设置 -- 单个修改
|
|
|
+ */
|
|
|
public function actionModifyHomeAmount()
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
@@ -862,6 +865,40 @@ class CustomController extends BaseController
|
|
|
util::complete('修改成功');
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 上门最低消费设置 -- 针对批发商客户进行批量修改
|
|
|
+ */
|
|
|
+ public function actionModifyAllHomeAmount()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $homeAmount = $get['homeAmount'] ?? 0;
|
|
|
+ $homeType = $get['homeType'] ?? 0;
|
|
|
+
|
|
|
+ // 批量更新客户信息
|
|
|
+ CustomClass::updateByCondition(
|
|
|
+ ['ownMainId' => $this->mainId],
|
|
|
+ ['homeAmount' => $homeAmount, 'homeType' => $homeType]
|
|
|
+ );
|
|
|
+
|
|
|
+ // 获取需要更新的供货商 ID
|
|
|
+ $customs = CustomClass::getAllList('ghsId', ['ownMainId' => $this->mainId]);
|
|
|
+ $ghsIds = [];
|
|
|
+ foreach ($customs as $custom) {
|
|
|
+ if (!empty($custom['ghsId'])) {
|
|
|
+ $ghsIds[] = $custom['ghsId'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 批量更新供货商信息
|
|
|
+ if (!empty($ghsIds)) {
|
|
|
+ GhsClass::updateByCondition(
|
|
|
+ ['id' => ['in', array_unique($ghsIds)]],
|
|
|
+ ['homeAmount' => $homeAmount, 'homeType' => $homeType]
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ util::complete('修改成功');
|
|
|
+ }
|
|
|
+
|
|
|
//允许月结开关 ssh 2021.1.8
|
|
|
public function actionDebt()
|
|
|
{
|