From 9838c5d08e1c6d581db05775b53251819948c8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=A1=83?= <1098598843@qq.com> Date: Tue, 7 Feb 2023 16:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E8=B4=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/order/StoreCartDg.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controller/api/store/order/StoreCartDg.php b/app/controller/api/store/order/StoreCartDg.php index 1f1cac31..badba6c2 100644 --- a/app/controller/api/store/order/StoreCartDg.php +++ b/app/controller/api/store/order/StoreCartDg.php @@ -200,18 +200,19 @@ class StoreCartDg extends BaseController Db::startTrans(); try { $params = $this->request->params(['cart_ids','name','address','phone']); - $is_have = Db::table('eb_store_cart_dg_nopay')->where('uid',$this->request->uid())->find(); + $is_have = Db::table('eb_store_cart_dg_nopay')->where('uid',$this->request->uid())->where('cart_ids',$params['cart_ids'])->find(); if($is_have){ - $params['update_time'] = time(); - Db::table('eb_store_cart_dg_nopay')->where('id',$is_have['id'])->strict(false)->field(true)->update($params); - $nopay_id = $is_have['id']; + return app('json')->fail('已保存'); +// $params['update_time'] = time(); +// Db::table('eb_store_cart_dg_nopay')->where('id',$is_have['id'])->strict(false)->field(true)->update($params); +// $nopay_id = $is_have['id']; }else{ $params['create_time'] = time(); $params['uid'] = $this->request->uid(); $nopay_id = Db::table('eb_store_cart_dg_nopay')->strict(false)->field(true)->insertGetId($params); } // 删除购物车里数据 - $where[] = ['cate_id','in',$params['cart_ids']]; + $where[] = ['cart_id','in',$params['cart_ids']]; $data['is_del'] = 1; $data['nopay_id'] = $nopay_id; Db::table('eb_store_cart_dg')->where($where)->update($data);