添加本地生活商品删除功能

This commit is contained in:
wangxiaowei 2024-09-15 09:33:53 +08:00
parent d2f2092ec1
commit 0ea09d0aa1
2 changed files with 21 additions and 0 deletions

@ -83,4 +83,14 @@ class LocalStoreGoods extends Api
}
return JsonServer::error('操作失败');
}
public function delGoods()
{
$form = $this->request->post();
$result = LocalStoreGoodsLogic::delGoods($form, $this->user_id);
if ($result) {
return JsonServer::success('操作成功');
}
return JsonServer::error('操作失败');
}
}

@ -286,6 +286,17 @@ class LocalStoreGoodsLogic extends Logic
return false;
}
public static function delGoods($form, $user_id)
{
$result = LocalStoreGoods::where([
'id' => $form['id'],
'user_id' => $user_id
])->update(['delete_time' => time()]);
return $result;
}
// 添加规格
private static function addSpec($id, $user_id, $form)
{
$len = strlen(Config::get('aliyunoss.domain'));