|
|
@@ -323,16 +323,15 @@ class ProductController extends BaseController
|
|
|
util::fail('请在首店修改');
|
|
|
}
|
|
|
|
|
|
- $data = Yii::$app->request->post('data', ''); //data = [{id:1,inTurn:10,addPrice:2,cost:10}]
|
|
|
+ $data = Yii::$app->request->post('data', '');
|
|
|
$type = Yii::$app->request->post('type', '');
|
|
|
if (empty($data) || empty($type)) {
|
|
|
util::fail("参数错误");
|
|
|
}
|
|
|
- if (in_array($type, ['inTurn', 'addPrice', 'cost', 'weight', 'ratio', 'ratio', 'price', 'stockWarning', 'shelfLife'])) {
|
|
|
- $data = json_decode($data, true);
|
|
|
- } else {
|
|
|
- util::fail('非法操作');
|
|
|
+ if (in_array($type, ['inTurn', 'addPrice', 'qtAddPrice', 'byAddPrice', 'hjAddPrice', 'zsAddPrice', 'cost', 'weight', 'ratio', 'ratio', 'price', 'stockWarning', 'shelfLife']) == false) {
|
|
|
+ util::fail('非法数据修改');
|
|
|
}
|
|
|
+ $data = json_decode($data, true);
|
|
|
foreach ($data as $v) {
|
|
|
if ($type == 'status') {
|
|
|
$val = $v[$type] ?? '';
|