|
|
@@ -75,19 +75,19 @@ class PicTextController extends BaseController
|
|
|
$switch = $post['switch'] ?? 0;
|
|
|
$shopId = $this->shopId;
|
|
|
$picTextId = intval($post['picTextId']);
|
|
|
- $shop = $this->shop;
|
|
|
$ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
|
|
|
if (empty($ext)) {
|
|
|
util::fail('门店信息缺失呢');
|
|
|
}
|
|
|
- $ext->purchaseGuide = $picTextId;
|
|
|
- $ext->save();
|
|
|
- if($switch == 1){
|
|
|
- $shop->buyNotice = 1;
|
|
|
- }else{
|
|
|
- $shop->buyNotice = 0;
|
|
|
+ if ($switch == 1) {
|
|
|
+ if (empty($picTextId) || !is_numeric($picTextId)) {
|
|
|
+ util::fail('请先择图文');
|
|
|
+ }
|
|
|
+ $ext->purchaseGuide = $picTextId;
|
|
|
+ } else {
|
|
|
+ $ext->purchaseGuide = 0;
|
|
|
}
|
|
|
- $shop->save();
|
|
|
+ $ext->save();
|
|
|
util::complete('修改成功');
|
|
|
}
|
|
|
|