更新转售商品查询条件

This commit is contained in:
yaooo 2023-08-22 15:36:17 +08:00
parent 45fb87ffa9
commit 84d6c47f66

View File

@ -609,7 +609,7 @@ class Community extends BaseController
*/
public function editResale($id)
{
$communityInfo = Db::name('community')->where('uid', $this->request->uid())->where('community_id', $id)->whereIn('status', '0,-1')->where('is_del', 0)->find();
$communityInfo = Db::name('community')->where('uid', $this->request->uid())->where('community_id', $id)->where('is_del', 0)->find();
if (!$communityInfo) {
return app('json')->fail('转售商品不存在');
}
@ -623,7 +623,7 @@ class Community extends BaseController
Db::name('store_product_attr_value')->where('product_id', $prod['product_id'])->where('unique', $prod['product_attr_unique'])->inc('stock', $prod['number'])->update();
}
Db::name('resale')->where('community_id', $id)->where('status', 0)->update(['is_del' => 1]);
Db::name('community')->where('uid', $this->request->uid())->where('community_id', $id)->update(['is_del' => 1]);
Db::name('community')->where('uid', $this->request->uid())->where('community_id', $id)->update(['is_del' => 1, 'status' => -1]);
Db::commit();
} catch (\Exception $e) {
Db::rollback();