添加修改状态功能
This commit is contained in:
parent
db2edf342c
commit
9fb3dcfba1
@ -66,8 +66,7 @@ class LocalStoreGoods extends Api
|
||||
public function setState()
|
||||
{
|
||||
$form = $this->request->post();
|
||||
dump($form);die;
|
||||
// $result = LocalStoreGoodsLogic::setState($form);
|
||||
$result = LocalStoreGoodsLogic::setState($form, $this->user_id);
|
||||
|
||||
}
|
||||
}
|
||||
@ -152,8 +152,17 @@ class LocalStoreGoodsLogic extends Logic
|
||||
}
|
||||
|
||||
// 设置状态
|
||||
public static function setState($form)
|
||||
public static function setState($form, $user_id)
|
||||
{
|
||||
if (isset(self::$STATUS[$form['type']])) {
|
||||
$state = self::$STATUS[$form['type']];
|
||||
dump($state);die;
|
||||
$result = LocalStoreGoods::where(['id' => $form['id'], 'user_id' => $user_id, 'lstore_id' => $form['lstore_id']])->update([
|
||||
'state' => $state,
|
||||
]);
|
||||
|
||||
return $result;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user