添加修改状态功能

This commit is contained in:
wangxiaowei 2024-08-23 14:23:28 +08:00
parent db2edf342c
commit 9fb3dcfba1
2 changed files with 11 additions and 3 deletions

@ -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;
}
}