123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582 |
- <?php
- namespace app\api\controller;
- use app\common\library\AliPay;
- use app\common\library\Shande;
- use app\common\library\ShandeRapid;
- use think\cache\driver\Redis;
- use think\Db;
- use think\Exception;
- use EasyWeChat\Factory;
- use think\Session;
- use function Sodium\add;
- /**
- * @title 订单
- * @controller Order
- * @group base
- */
- class Order extends Base
- {
- public function initialize()
- {
- parent::initialize();
- parent::check_login();
- }
- /**
- * @title 生成订单(立即购买 )
- * @desc 生成订单(立即购买 )
- * @author Gavin
- * @url /api/Order/createOrder
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:id type:int require:1 default:-- desc:藏品id
- * @param name:num type:int require:1 default:1 desc:数量
- * @param name:pay_type type:string require:1 default:wx desc:wx:微信zfb:支付宝wallet:钱包余额sd:杉德h5,sd_rapid:杉德快捷支付
- * @param name:from type:string require:1 default:wx desc:wx:微信公众号h5:网页【微信支付用的着,其他支付忽略】
- *
- * @return name:order_no type:int require:0 default:0 desc:订单号
- * @return name:pay type:string require:0 default:0 desc:支付信息
- */
- public function createOrder()
- {
- if (redisSetNx('createOrder'.$this->uid,3)) {
- $id = input('id');
- $num = input('num',1);
- $pay_type = input('pay_type','wx');
- $from = input('from','wx');
- if (!$id || $num <= 0) $this->error('参数错误');;
- $user = Db::name('store_member')->where('id',$this->uid)->find();
- if ($user['is_auth']==0) $this->error('请实名认证后购买!');
- if (!$user['wallet_address']) $this->error('钱包地址未生成,请等待...');
- $coll_info = getCollectionInfoHash($id);
- if ($coll_info['is_deleted']==1 || $coll_info['status']==0) $this->error('藏品已下架');
- if($pay_type != 'wallet') $this->error('请选择余额方式支付');
- // 抽签发行方式验证是否中签
- if($coll_info['issue_mode'] == 2){
- $check_redis = new Redis();
- $luck_draw = $check_redis->get('lucky_draw_'.$id);
- if(!$luck_draw) $this->error('抽签未出结果');
- $luck_draw = json_decode($luck_draw,true);
- if(!in_array($this->uid,$luck_draw)) $this->error('没有中签');
- }
- $inventory = getCollectionInventory($id);
- if ($inventory<1) $this->error('已售罄');
- if ($inventory<$num) $this->error('库存不足');
- // 验证产品赋能优先购
- $set_time = $coll_info['sell_time'];
- $priority = false;
- if($coll_info['issue_mode'] == 1) {
- $priority = checkMemberPriority($this->uid,$coll_info['id']);
- if($priority && isset($coll_info['before_time'])){
- $sell_time = strtotime($coll_info['sell_time'])-($coll_info['before_time'] * 60);
- if ($sell_time <= time()) $info['state'] = 1;
- $coll_info['sell_time'] = date('Y-m-d H:i:s',$sell_time);
- }
- }
- $sell_time = strtotime($coll_info['sell_time']);
- if ($sell_time>time()) $this->error('商品还未开始售卖!请耐心等待');
- //获取用户已经购买数量
- $userByCount = getByCount($this->uid,$id);
- // 设置了限购数量 && 购买的数量达到了限购数量 && 未到正式开售时间
- if($priority && $priority !== true && $userByCount + $num > $priority && strtotime($set_time) > time()) $this->error('最多提前购买'.intval($priority).'个');
- if ($coll_info['buy_count']<($userByCount+$num)) $this->error('每人限购'.$coll_info['buy_count'].'个');
- //获取是否已经铸造hash
- $hashCount = getLenCollection($id);
- if ((!$hashCount || $hashCount<$num) && $coll_info['type'] != 3) $this->error('hash未铸造,无法购买');
- if($pay_type == 'wx'){
- if ($from=='wx' && !$user['openid']) $this->error('微信未授权,无法购买');
- }
- if ($pay_type=='zfb') $this->error('支付宝暂未开通');
- $total_fee = bcmul($coll_info['price'],$num,2);
- if($pay_type == 'wallet' && $user['money'] < $total_fee) $this->error('余额不足');
- //先减掉库存
- loseCollectionInventory($id,$num);
- //先增加购买数量
- IncrByCount($this->uid,$id,$num);
- $order_no = get_order_sn();
- $total_price = $total_fee;//总金额
- $redis_data = [
- 'mid'=>$this->uid,
- 'c_id'=>$id,
- 'order_no'=>$order_no,
- 'inventory'=>$coll_info['inventory'],
- 'num'=>$num,
- 'pro_info'=>json_encode($coll_info),
- 'status'=>0,
- 'create_at'=>date('Y-m-d H:i:s'),
- 'total_price'=>$total_price,
- 'pay_price'=>$total_fee,
- 'pay_type'=>$pay_type,
- ];
- $com = true;
- $retrun_data['order_no'] = $order_no;
- $retrun_data['pay'] = '';
- $retrun_data['user_id'] = $this->uid;
- if ($com){
- $redis = new Redis();
- //收集下单用户id
- setCollectionBuyUser($this->uid);
- $redis->hMSet('order_not_pay_'.$this->uid,[$order_no=>json_encode($redis_data)]); //存入redis
- DelRedisSetNx('createOrder'.$this->uid);
- $this->success('成功',$retrun_data);
- }else{
- //加上库存
- addCollectionInventory($id,$num);
- //减少用户购买数量
- DecrByCount($this->uid,$id,$num);
- DelRedisSetNx('createOrder'.$this->uid);
- $this->error('服务器繁忙,请稍后重试');
- }
- }else{
- $this->error('服务器繁忙,请稍后重试');
- }
- }
- /**
- * @title 我的订单-待支付、已购买
- * @desc 我的订单-待支付、已购买
- * @author Gavin
- * @url /api/Orde/getMyOrderList
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:status type:int : default:0 desc:0:待支付1:已购买
- * @param name:page type:int : default:1 desc:页数
- * @param name:page_num type:int : default:20 desc:每页数
- *
- * @return name:order_no type:string default:-- desc:订单号
- * @return name:num type:int default:-- desc:数量
- * @return name:pay_price type:string default:-- desc:订单金额
- * @return name:status type:int default:-- desc:类型0:待支付1:已支付
- * @return name:cancel_time type:string default:-- desc:待支付自动取消时间
- * @return name:pay_type type:string default:-- desc:支付方式wx:微信zfb:支付宝
- * @return name:create_at type:string default:-- desc:创建时间
- * @return name:pro_info@name type:string default:-- desc:藏品名称
- * @return name:pro_info@cover type:string default:-- desc:藏品图片
- * @return name:pro_info@price type:string default:-- desc:藏品单价
- * @return name:pro_info@auth_img type:string default:-- desc:藏品作者头像
- * @return name:pro_info@auth_name type:string default:-- desc:藏品作者名称
- */
- public function getMyOrderList(){
- $status = input('status',0);
- if ($status==0){
- $redis = new Redis();
- $key = 'order_not_pay_'.$this->uid;
- $count = $redis->hGetLen($key);
- $list = $redis->hGetvals($key);
- if ($list){
- //自动取消分钟数
- $cancel_time = getCancelTime();
- foreach ($list as $k=>&$v){
- $info = json_decode($v,true);
- $info['pro_info'] = json_decode($info['pro_info'],true);
- $info['cancel_time'] = date('Y-m-d H:i:s',strtotime($info['create_at'])+($cancel_time*60));
- $info['create_int'] = strtotime($info['create_at']);
- $list[$k] = $info;
- }
- array_multisort(array_column($list,'create_int'),SORT_DESC,$list);
- }
- }else{
- $where = [
- 'is_deleted'=>0,
- 'status'=>$status,
- 'mid'=>$this->uid
- ];
- $count = Db::name('store_order')->where($where)->count();
- $list = Db::name('store_order')
- ->where($where)
- ->field('id,c_id,order_no,num,pro_info,status,create_at,pay_price,pay_type')
- ->order('id desc')
- ->limit($this->off_set,$this->page_num)
- ->select();
- foreach ($list as &$v){
- $v['pro_info'] = json_decode($v['pro_info'],true);
- }
- }
- $this->success('成功',compact('count','list'));
- }
- /**
- * @title 待支付、已购买订单详情
- * @desc 待支付、已购买订单详情
- * @author Gavin
- * @url /api/Order/MyOrderListDetail
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:order_no type:string default:0 desc:订单号
- * @param name:type type:int default:1 desc:1:待支付2:已支付
- *
- * @return name:order_no type:string default:-- desc:订单号
- * @return name:num type:int default:-- desc:数量
- * @return name:pay_price type:string default:-- desc:订单金额
- * @return name:status type:int default:-- desc:类型0:待支付1:已支付
- * @return name:cancel_time type:string default:-- desc:待支付自动取消时间
- * @return name:create_at type:string default:-- desc:创建时间
- * @return name:pay_at type:string default:-- desc:支付时间
- * @return name:pay_type type:string default:-- desc:支付方式wx:微信zfb:支付宝,sd杉德,sd_rapid:杉德快捷支付
- * @return name:pro_info@name type:string default:-- desc:藏品名称
- * @return name:pro_info@cover type:string default:-- desc:藏品图片
- * @return name:pro_info@price type:string default:-- desc:藏品单价
- * @return name:pro_info@auth_img type:string default:-- desc:藏品作者头像
- * @return name:pro_info@auth_name type:string default:-- desc:藏品作者名称
- */
- public function MyOrderListDetail(){
- $order_no = input('order_no');
- $type = input('type',1);
- if (!$order_no) $this->error('参数错误');
- if ($type==1){
- $redis = new Redis();
- $key = 'order_not_pay_'.$this->uid;
- $order = $redis->hGet($key,$order_no);
- $order = json_decode($order,true);
- }else{
- $order = Db::name('store_order')
- ->where('order_no',$order_no)
- ->where('mid',$this->uid)
- ->where('is_deleted',0)
- ->find();
- }
- if (!$order) $this->error('订单不存在');
- $order['pro_info'] = json_decode($order['pro_info'],true);
- //自动取消分钟数
- $cancel_time = getCancelTime();
- if ($order['status']==0){
- $order['cancel_time'] = date('Y-m-d H:i:s',strtotime($order['create_at'])+($cancel_time*60));
- }
- $this->success('成功',$order);
- }
- /**
- * @title 待支付订单支付
- * @desc 待支付订单支付
- * @author Gavin
- * @url /api/Order/payOrder
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:order_no type:string require:1 default:-- desc:订单号
- * @param name:from type:string require:1 default:wx desc:wx:微信公众号,h5:网页:wallet余额,sd:杉德h5,sd_rapid:杉德快捷支付
- *
- * @return name:order_no type:int require:0 default:0 desc:订单号
- * @return name:pay type:string require:0 default:0 desc:支付信息
- * @return name:order_no type:string default:0 desc:支付单号(sd)
- * @return name:extend type:int default:0 desc:用户id(sd)
- * @return name:pay type:array default:0 desc:支付信息(sd)
- * @return name:pay.body type:array default:0 desc:支付信息(sd)
- * @return name:pay.totalAmount type:string default:0 desc:支付金额【000000010000是100元】(sd)
- * @return name:pay.orderCode type:string default:0 desc:支付单号(sd)
- * @return name:pay.credential type:string default:0 desc:正书(sd)
- */
- public function payOrder(){
- $user = getMemberInfoHash($this->uid); //获取用户信息
- $order_no = input('order_no'); //订单号
- $from = input('from','wx');
- if (!$order_no) $this->error('参数错误');
- $redis = new Redis();
- $key = 'order_not_pay_'.$this->uid;
- $order = $redis->hGet($key,$order_no);
- if (!$order) $this->error('订单不存在'.$this->uid);
- $order = json_decode($order,true);
- if ($order['status']!=0) $this->error('订单已支付或已取消');
- $CancelTime = getCancelTime();
- if (strtotime($order['create_at']) + $CancelTime * 60 < time()) $this->error('订单超时');
- $order_no = $order['order_no'];
- $total_fee = $order['pay_price'];
- $pay_type = $order['pay_type'];
- $body = '象链数藏购买藏品';
- $com = true;
- $retrun_data = [];
- if($pay_type != 'wallet') $this->error('请选择余额方式支付');
- switch ($pay_type){
- case 'wx':
- $config = retrunWxConfig();
- $total_fee = $total_fee * 100;
- $config['notify_url'] = 'https://'.$_SERVER['HTTP_HOST'].'/index.php/api/Pay/WxOrderNotify';
- $app = Factory::payment($config);
- $post_data = [
- 'body' => $body,
- 'out_trade_no' => $order_no,
- 'total_fee' => $total_fee,
- 'attach'=>$this->uid, //自定义传值
- ];
- //trade_type SAPI--JSAPI支付(或小程序支付)、NATIVE--Native支付、APP--app支付,MWEB--H5支付
- if ($from=='wx'){
- $post_data['openid'] = $user['openid'];
- $post_data['trade_type'] = 'JSAPI';
- }elseif ($from=='h5'){
- $post_data['trade_type'] = 'MWEB';
- }
- $result = $app->order->unify($post_data);
- if ($result['return_msg']=='OK'){
- if ($result['result_code']=='FAIL'){
- $com = false;
- }else{
- $order1 = $app->jssdk->bridgeConfig($result['prepay_id']);//执行二次签名返回参数
- $redis_data['wx_order'] = $order1;
- $retrun_data['order_no'] = $order_no;
- if($from == 'h5'){
- $retrun_data['pay'] = $result['mweb_url'];
- }else{
- $retrun_data['pay'] = json_decode($order1,true);
- }
- }
- }else{
- $com = false;
- }
- break;
- case 'zfb':
- $zfb = new AliPay();
- $notify_url = $this->request->root(true).'/index.php/api/Pay/alipayOrderNotify?attach='.$this->uid;//回调地址
- $order = $zfb->ali_pay_pc($body, $total_fee, $order_no, $notify_url,'https://'.$_SERVER['HTTP_HOST'].'/h5/pages/mine/order-list?num=1');//调用支付宝支付的方法
- $retrun_data['order_no'] = $order_no;
- $retrun_data['pay'] = $order;
- break;
- case 'sd':
- $client = new Shande();
- $notify_url = 'https://'.$_SERVER['HTTP_HOST'].'/api/Pay/shandeOrderNotify';//回调地址
- $total_fee = $total_fee*100;
- $lenth = strlen($total_fee);
- $total_fee = get0number($lenth).$total_fee;
- $result = $client->orderPay($order_no.'S'.$this->uid,$total_fee,$body,$notify_url,'https://'.$_SERVER['HTTP_HOST'].'/h5/pages/mine/mine',$user['bank_num']);
- $retrun_data['order_no'] = $order_no;
- $retrun_data['extend'] = $this->uid;
- $retrun_data['pay'] = json_decode($result['data'],true);
- if( $retrun_data['pay']['head']['respCode'] != '00000')$this->error($retrun_data['pay']['head']['respMsg'].'请重新下单');
- break;
- case 'wallet':
- Db::startTrans();
- try{
- $balance = Db::name('store_member')->where('id',$this->uid)->value('money');
- if($balance < $total_fee) throw new Exception('余额不足');
- $pay_res = (new Pay())->dealData(['out_trade_no' => $order_no,'attach'=>$this->uid]);
- if(!$pay_res) throw new Exception('支付失败');
- $order_id = Db::name('store_order_info')->where(['order_no'=>$order_no])->value('id');
- $change_money = memberMoneyChange($total_fee,3,$this->uid,'余额支付',0,$order_id,4);
- if(!$change_money) throw new Exception('支付失败');
- setMemberInfoHash($this->uid);
- Db::commit();
- }catch (\Exception $e){
- $com = false;
- $msg= $e->getMessage();
- Db::rollback();
- }
- $retrun_data = null;
- break;
- case 'sd_rapid' :
- if(!$user['true_name'] || !$user['id_card']) $this->error('请实名认证,在进行订单支付');
- $rapid = new ShandeRapid();
- $notify_url = 'https://'.$_SERVER['HTTP_HOST'].'/api/Pay/shandeOrderNotify';//回调地址
- //$return_url = 'https://'.$_SERVER['HTTP_HOST'].'/h5/pages/mine/mine';//回调地址
- $return_url ='https://'.$_SERVER['HTTP_HOST']."/h5/pages/mine/mine?id={$order['c_id']}&orderNo={$order_no}";//回调地址
- $pay_extra = json_encode(['userId'=>"$this->uid",'userName'=>$user['true_name'],'idCard'=>$user['id_card']]);
- $pay_url = $rapid->payOrder($order_no.'S'.$this->uid,$total_fee,$notify_url,$return_url,$pay_extra,$body);
- parse_str(parse_url($pay_url)['query'],$pay_query);
- $retrun_data['parse_url'] = parse_url($pay_url)['query'];
- $retrun_data['order_no'] = $order_no;
- $retrun_data['extend'] = $this->uid;
- $retrun_data['pay_url'] = $pay_url;
- $retrun_data['pay_query'] = $pay_query;
- break;
- }
- if ($com){
- if($pay_type == 'wallet')$this->success('支付成功');
- $this->success('成功',$retrun_data);
- }else{
- if($pay_type == 'wallet')$this->error($msg);
- $this->error('调起支付失败,请稍后重试');
- }
- }
- /**
- * @title 取消订单
- * @desc 取消订单
- * @author Gavin
- * @url /api/Order/cancelOrder
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:order_no type:string require:1 default:-- desc:订单号
- */
- public function cancelOrder(){
- $order_no = input('order_no');
- if (!$order_no) $this->error('参数错误');
- $redis = new Redis();
- $key = 'order_not_pay_'.$this->uid;
- $order = $redis->hGet($key,$order_no);
- if (!$order) $this->error('订单不存在');
- $order = json_decode($order,true);
- if ($order['status']!=0) $this->error('订单已支付或已取消');
- $com = true;
- Db::startTrans();
- try {
- $order['status'] = 2;
- $order['cancel_at'] = date('Y-m-d H:i:s');
- $order['cancel_state'] = 2;
- Db::name('store_order')->insert($order);
- Db::commit();
- }catch (\Exception $e){
- $com=false;
- Db::rollback();
- }
- if ($com){
- //加上库存
- addCollectionInventory($order['c_id'],$order['num']);
- //减少用户购买数量
- DecrByCount($this->uid,$order['c_id'],$order['num']);
- //删除数据
- $redis->hdel($key,$order_no);
- $this->success('取消成功');
- }else{
- $this->error('取消失败,请稍后重试');
- }
- }
- /**
- * @title 我的订单-转赠
- * @desc 我的订单-转赠
- * @author Gavin
- * @url /api/Order/getMySendList
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:page type:int : default:1 desc:页数
- * @param name:page_num type:int : default:20 desc:每页数
- *
- * @return name:order_no type:string default:-- desc:订单号
- * @return name:over_time type:string default:-- desc:转赠时间
- * @return name:status type:int default:-- desc:类型2:赠出3:获赠
- * @return name:send_name type:string default:-- desc:转赠者/受赠者
- * @return name:collectors_hash type:string default:-- desc:hash
- * @return name:pro_info@name type:string default:-- desc:藏品名称
- * @return name:pro_info@price type:string default:-- desc:藏品价格
- * @return name:pro_info@price type:string default:-- desc:藏品单价
- * @return name:pro_info@auth_img type:string default:-- desc:藏品作者头像
- * @return name:pro_info@auth_name type:string default:-- desc:藏品作者名称
- */
- public function getMySendList(){
- $where = [
- 'mid'=>$this->uid,
- ];
- $count = Db::name('store_order_info')->where($where)->whereIn('status','2,3')->count();
- $list = Db::name('store_order_info')
- ->where($where)
- ->whereIn('status','2,3')
- ->field('id,order_no,pro_info,over_time,create_at,status,to_mid,collectors_hash')
- ->order('over_time desc ,id desc')
- ->limit($this->off_set,$this->page_num)
- ->select();
- foreach ($list as &$v){
- $v['pro_info'] = json_decode($v['pro_info'],true);
- $v['send_name'] = Db::name('store_member')->where('id',$v['to_mid'])->value('name');
- }
- $this->success('成功',compact('count','list'));
- }
- /**
- * @title 转赠订单详情
- * @desc 转赠订单详情
- * @author Gavin
- * @url /api/Order/getMySendListDetail
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:order_id type:int : default:1 desc:订单ID
- *
- * @return name:order_no type:string default:-- desc:订单号
- * @return name:over_time type:string default:-- desc:转赠时间
- * @return name:status type:int default:-- desc:类型2:赠出3:获赠
- * @return name:send_name type:string default:-- desc:转赠者/受赠者
- * @return name:collectors_hash type:string default:-- desc:hash
- * @return name:pro_info@name type:string default:-- desc:藏品名称
- * @return name:pro_info@price type:string default:-- desc:藏品价格
- * @return name:pro_info@price type:string default:-- desc:藏品单价
- * @return name:pro_info@auth_img type:string default:-- desc:藏品作者头像
- * @return name:pro_info@auth_name type:string default:-- desc:藏品作者名称
- */
- public function getMySendListDetail(){
- $order_id = input('order_id'); //订单id
- if (!$order_id) $this->error('参数错误');
- $order = Db::name('store_order_info')
- ->where('id',$order_id)
- ->where('mid',$this->uid)
- ->find();
- if (!$order) $this->error('订单不存在');
- $order['pro_info'] = json_decode($order['pro_info'],true);
- $order['num'] = 1;
- $order['pay_price'] = 0;
- $order['send_name'] = '--';
- if($order['to_mid']) $order['send_name'] = Db::name('store_member')->where('id',$order['to_mid'])->value('name');
- $this->success('成功',$order);
- }
- function savetest($order_no){
- $result['out_trade_no'] = $order_no;
- $order = Db::name('store_order')->where('order_no',$result['out_trade_no'])->find();
- if ($order['status']==0){
- Db::startTrans();
- try {
- Db::name('store_order')
- ->where('order_no',$result['out_trade_no'])
- ->update(['status'=>1,'pay_at'=>date('Y-m-d H:i:s'),'return_success_info'=>json_encode($result,true)]);
- $array = [];
- for ($i=0;$i<$order['num'];$i++){
- //获取排名
- $rank = getRanking($order['c_id']);
- $tag = getTag($order['c_id'],$rank,$order['inventory']);
- saveRanking($order['c_id']);
- $company = '象寻数字科技(上海)有限公司';
- $company_hash = '';
- $company_hash_time = '';
- $collectors_hash = '';
- $date = [
- 'order_id'=>$order['id'],
- 'order_no'=>get_order_sn(),
- 'tag'=>$tag,
- 'mid'=>$order['mid'],
- 'pro_info'=>$order['pro_info'],
- 'company'=>$company,
- 'company_hash'=>$company_hash,
- 'company_hash_time'=>$company_hash_time,
- 'collectors_hash'=>$collectors_hash,
- 'collectors_hash_time'=>date('Y-m-d H:i:s')
- ];
- $array[] = $date;
- }
- Db::name('store_order_info')->insertAll($array);
- Db::commit();
- // return true;
- } catch (\Exception $e){
- Db::rollback();
- //return false;
- }
- }
- }
- }
|