|
|
@@ -21,7 +21,7 @@ class MerchantController extends BaseController
|
|
|
MerchantExtendService::updateByCondition(['merchantId' => $this->merchantId], ['freeDistance' => $first, 'freight' => $add]);
|
|
|
util::complete();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//商家信息 shish 2019.12.8
|
|
|
public function actionDetail()
|
|
|
{
|
|
|
@@ -49,18 +49,33 @@ class MerchantController extends BaseController
|
|
|
if (empty($list) || is_array($list) == false) {
|
|
|
util::fail('请填写会员等级');
|
|
|
}
|
|
|
+ if (count($list) > 9) {
|
|
|
+ util::fail('最多可以设置9个等级');
|
|
|
+ }
|
|
|
$data = [];
|
|
|
foreach ($list as $key => $val) {
|
|
|
+ if ($key > 0) {
|
|
|
+ $currentGrowth = $val[1];
|
|
|
+ $previousGrowth = $list[$key - 1][1];
|
|
|
+ if ($currentGrowth <= $previousGrowth) {
|
|
|
+ util::fail('等级越高成长值也要越高');
|
|
|
+ }
|
|
|
+ $currentDiscount = $val[2];
|
|
|
+ $previousDiscount = $list[$key - 1][2];
|
|
|
+ if ($currentDiscount >= $previousDiscount) {
|
|
|
+ util::fail('等级越高折扣要越低');
|
|
|
+ }
|
|
|
+ }
|
|
|
$data[] = $val[0] . '_' . $val[1] . '_' . $val[2];
|
|
|
}
|
|
|
if (empty($data)) {
|
|
|
util::fail('请填写会员等级!');
|
|
|
}
|
|
|
$string = implode('I', $data);
|
|
|
- MerchantExtendService::updateByCondition(['merchantId' => $this->merchantId], ['gradeList' => $string]);
|
|
|
+ MerchantExtendService::updateByCondition(['merchantId' => $this->merchantId], ['gradeList' => $string, 'gradeSwitch' => 0]);
|
|
|
util::complete('提交成功');
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//常用链接
|
|
|
public function actionCommonUrl()
|
|
|
{
|