Commit 134351d7 authored by zhuwei's avatar zhuwei

批量修改是否参与活动

parent 6b2ff978
......@@ -427,4 +427,26 @@ class CostParameter extends Basic
return $this->response($code, $msg);
}
/**
* 批量修改是否参与活动
* @return \think\Response
*/
public function editDiscounts()
{
$params = $this->params;
// $params = array(
// "id_discounts_json" => '[{"id":1,"discounts":1},{"id":1,"discounts":1}]',
// );
if(!$params['id_discounts_json'])
return $this->response("101", 'id_discounts_json不能为空');
$id_value_json = json_decode($params['id_discounts_json'],true);
foreach ($id_value_json as $k => $v) {
if((isset($v['id']) && $v['id']> 0) && (isset($v['discounts']) && in_array($v['discounts'], [0,1])))
$f_params['is_discounts'] = $v['discounts'];
$this->updateStoreData($v['id'], $params);
}
return $this->response("200", "成功");
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment