refactor(api): 优化产品数据处理

- 在 IndexController 中添加数据解码步骤
- 使用 json_decode 将请求数据转换为关联数组
- 优化产品 ID 的验证逻辑
This commit is contained in:
mkm 2024-11-29 20:10:58 +08:00
parent c6906f36e5
commit 834532a24d

View File

@ -286,6 +286,7 @@ class IndexController extends BaseApiController
{
$data = $this->request->post();
if ($data) {
$data=json_decode($data,true);
if ($data['product_id'] > 0) {
$find = Db::name('wps_product')->where('product_id', $data['product_id'])->find();
$arr = [];