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);