|
|
@@ -370,15 +370,24 @@ class ProductController extends BaseController
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- $where = [];
|
|
|
- $where['id'] = $id;
|
|
|
- $where['shopId'] = $this->shopId;
|
|
|
- $where['sjId'] = $this->sjId;
|
|
|
- if (empty($val)) {
|
|
|
- util::fail("参数错误!");
|
|
|
+// $where = [];
|
|
|
+// $where['id'] = $id;
|
|
|
+// $where['shopId'] = $this->shopId;
|
|
|
+// $where['sjId'] = $this->sjId;
|
|
|
+// if (empty($val)) {
|
|
|
+// util::fail("参数错误!");
|
|
|
+// }
|
|
|
+// $data = [$type => $val];
|
|
|
+// ProductClass::updateByCondition($where, $data);
|
|
|
+
|
|
|
+ $currentProduct = ProductClass::getById($id, true);
|
|
|
+ if ($currentProduct->shopId != $this->shopId) {
|
|
|
+ util::fail('非常操作');
|
|
|
}
|
|
|
+ $currentProduct->$type = $val;
|
|
|
+ $currentProduct->save();
|
|
|
$data = [$type => $val];
|
|
|
- ProductClass::updateByCondition($where, $data);
|
|
|
+
|
|
|
|
|
|
//2021.7.6 linqh 如果是首店,则更新全部分店
|
|
|
ProductClass::updateSyncProduct($id, $this->shopId, $data);
|