123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467 |
- <?php
- namespace app\api\controller;
- use app\common\model\BillApply;
- use app\common\model\User;
- use app\common\model\UserLevel;
- use app\common\model\LevelOrder as LOM;
- use app\common\model\UserLevelRank;
- use app\common\service\UserSynth;
- use EasyWeChat\Factory;
- use think\Db;
- /**
- * @title 会员等级订单
- * @controller LevelOrder
- * @group base
- */
- class LevelOrder extends Base
- {
- public function initialize()
- {
- parent::initialize();
- parent::checkLogin();
- }
- /**
- * @title 开通会员(续费)订单
- * @desc 开通会员(续费)订单
- * @author qc
- * @url /api/Level_order/createOrder
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:level_id type:int require:1 default:0 desc:会员等级
- * @param name:level_key type:int require:1 default:0 desc:等级价格的key值
- * @return name:order_id type:int default:0 desc:订单id
- */
- public function createOrder(){
- $level_id = input('post.level_id');
- $level_key = input('post.level_key');
- $user_info = User::where('id',$this->user_id)->field('id,group_id,is_first,account_type')->find();
- if($user_info['account_type'] == 1 && $user_info['is_first'] == 0) $this->error('请联系公司管理员进行会员开通');
- $user_vip = UserLevelRank::getUserVipInfo($this->user_id);
- if(!empty($user_vip) && $user_vip['level_id'] > 1) $this->error('已是会员,请联系平台');
- if(!empty($user_vip) && $user_vip['user_id'] != $this->user_id) $this->error('请联系已绑定企业账号');
- $level_set = UserLevel::where('id', $level_id)->find()->toArray();
- if (!$level_set['price']) $this->error('会员价格设置有误');
- $level_price = json_decode($level_set['price'], true);
- if (!isset($level_price[$level_key])) $this->error('会员价格设置有误.');
- $is_renew = \app\common\model\LevelOrder::where('user_id',$this->user_id)->where('status',1)->where('pay_state',1)->count();
- if(!empty($user_vip)) {
- $cal_time = strtotime('+'.$level_price[$level_key]['time'] .' month',$user_vip['end_time']);
- if($cal_time > strtotime('+3 years')) $this->error('会员续费期限最多3年');
- }
- // $price_total = $is_renew && $level_price[$level_key]['renew'] > 0 && $level_price[$level_key]['renew'] ? bcmul( $level_price[$level_key]['price'], $level_price[$level_key]['renew']/100,2) : $level_price[$level_key]['price'];
- $order_insert = [
- 'user_id' => $this->user_id,
- 'order_no' => get_order_sn(),
- 'level_id' => $level_id,
- 'level_key' => $level_key,
- 'month' => $level_price[$level_key]['time'],
- 'level_title' => $level_price[$level_key]['title'],
- 'price_total' =>$is_renew ? $level_price[$level_key]['renew'] : $level_price[$level_key]['price'],
- ];
- $order_info = LOM::create($order_insert);
- $this->success('ok', ['order_id' => $order_info->id]);
- }
- /**
- * @title 获取订单详情
- * @desc 获取订单详情
- * @author qc
- * @method GET
- * @url /api/Level_order/getOrderDetail
- * @header name:Authorization require:1 desc:Token
- * @param name:order_id type:int default:-- desc:订单id
- * @return name:id type:int default:-- desc:订单id
- * @return name:order_no type:string default:-- desc:订单号
- * @return name:price_total type:float default:-- desc:待支付金额
- * @return name:level_id type:float default:-- desc:等级id
- * @return name:level_name type:float default:-- desc:等级名称
- * @return name:month type:float default:-- desc:时长(月)
- * @return name:pay_state type:int default:-- desc:支付状态(0未支付1已支付)
- * @return name:pay_type type:int default:-- desc:支付方式(1.h5微信,2.h5支付宝,3.app微信,4.app支付宝,5.h5微信内支付)
- * @return name:pay_no type:string default:-- desc:支付号
- * @return name:pay_at type:string default:-- desc:支付时间
- * @return name:cancel_state type:int default:-- desc:取消状态(0未取消1已取消)
- * @return name:cancel_at type:string default:-- desc:取消时间
- * @return name:cancel_desc type:string default:-- desc:取消原因
- * @return name:cancel_desc type:string default:-- desc:取消原因
- * @return name:level_set type:array default:-- desc:购买会员设置
- * @return name:level_set.title type:string default:-- desc:标题
- * @return name:level_set.price type:float default:-- desc:价格
- * @return name:level_set.time type:int default:-- desc:时间(月)
- */
- public function getOrderDetail()
- {
- $order_id = input('get.order_id');
- $detail = LOM::where('id',$order_id)->find()->toArray();
- $level_set = UserLevel::where('id', $detail['level_id'])->find()->toArray();
- $detail['level_name'] = $level_set['name'];
- $detail['level_set'] = json_decode($level_set['price'],true)[$detail['level_key']];
- $this->success('',['detail'=>$detail]);
- }
- /**
- * @title 订单支付
- * @desc 订单支付
- * @author qc
- * @url /api/Level_order/payOrder
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:order_id type:int require:1 default:0 desc:订单id
- * @param name:pay_type type:int require:1 default:0 desc:支付方式(1.h5微信,2.h5支付宝,3.app微信,4.app支付宝)
- * @return name:config type:array default:0 desc:小程序支付配置
- * @return name:config.signType type:string default:-- desc:签名类型
- * @return name:config.appId type:string default:-- desc:appId【h5】
- * @return name:config.paySign type:string default:-- desc:签名【h5】
- * @return name:config.nonceStr type:string default:-- desc:随机字符串【h5】
- * @return name:config.timeStamp type:string default:-- desc:时间戳【h5】
- * @return name:config.appid type:string default:-- desc:appid【微信APP】
- * @return name:config.sign type:string default:-- desc:签名【微信APP】
- * @return name:config.noncestr type:string default:-- desc:随机字符串【微信APP】
- * @return name:config.timestamp type:string default:-- desc:时间戳【微信APP】
- * @return name:config.partnerid type:string default:-- desc:商户号
- * @return name:config.prepayid type:string default:-- desc:唯一支付号
- * @return name:config.package type:string default:-- desc:package
- * @return name:config.mch_id type:string default:-- desc:商户号(H5)
- * @return name:config.pay_no type:string default:-- desc:订单支付号(H5)
- * @return name:config.notify_url type:string default:-- desc:回调地址(H5)
- * @return name:config.total_fee type:int default:-- desc:支付金额(分!!!)
- * @return name:code_url type:string default:-- desc:付款码url
- * @return name:openid type:string default:-- desc:openid
- */
- public function payOrder()
- {
- $order_id = input('post.order_id');
- $pay_type = input('post.pay_type',1);
- $order_info = LOM::where('id',$order_id)->find()->toArray();
- if($order_info['status'] != 0) $this->error('订单状态错误');
- if($order_info['cancel_state'] != 0 || $order_info['is_deleted'] != 0) $this->error('订单异常');
- if($order_info['price_total'] <= 0) $this->error('订单金额错误');
- $user_vip = UserLevelRank::getUserVipInfo($this->user_id);
- if(!empty($user_vip)) {
- $cal_time = strtotime('+'.$order_info['month'] .' month',$user_vip['end_time']);
- if($cal_time > strtotime('+3 years')) $this->error('会员续费期限最多3年');
- }
- if(!empty($user_vip) && $user_vip['user_id'] != $this->user_id) $this->error('请联系已绑定企业账号');
- $pay_no = $order_info['pay_no'] ? $order_info['pay_no'] : get_order_sn();// 支付单号
- if(!$order_info['pay_no']) LOM::where('id',$order_id)->update(['pay_no'=>$pay_no]);
- $user_info = User::where('id',$this->user_id)->find()->toArray();
- $ret_data = ['pay_status'=>0,'config'=>[],'code_url'=>'','openid'=>$user_info['openid']];
- Db::startTrans();
- LOM::where('id',$order_id)->update(['pay_type'=>$pay_type]);
- try {
- switch ($pay_type){
- case 1://微信
- $notify_url = $this->request->root(true) . '/api/we_chat_pay/LevelOrderNotify';
- // $notify_url = 'https://gaoyixia.hdlkeji.com/api/we_chat_pay/LevelOrderNotify';
- $pay_config = WeChatPay::wxPay('订单支付',$pay_no,$order_info['price_total'],$notify_url,'MWEB');
- if($pay_config['code'] != 200) $this->exception($pay_config['msg']);
- $pay_config['config']['mch_id'] = config('app.wx_pay')['mch_id'];
- $pay_config['config']['pay_no'] = $pay_no;
- $pay_config['config']['notify_url'] = $notify_url;
- $pay_config['config']['mweb_url'] = $pay_config['mweb_url'];
- $pay_config['config']['total_fee'] = $order_info['price_total'] * 100;
- $ret_data['config'] = $pay_config['config'];
- break;
- case 2 :
- $notify_url = $this->request->root(true) . '/api/Alipay/LevelOrderNotify';
- $return_url ='https://'.$_SERVER['HTTP_HOST']."/dist/#/my";
- $config = Alipay::ali_pay_h5('订单支付',$pay_no,$order_info['price_total'],$notify_url,$return_url);
- $ret_data['config']['ali_url'] = $config;
- $ret_data['ali_url'] = $config;
- break;
- case 3:
- $notify_url = $this->request->root(true) . '/api/we_chat_pay/LevelOrderNotify';
- $pay_config = WeChatPay::wxPay('订单支付',$pay_no,$order_info['price_total'],$notify_url,'APP');
- if($pay_config['code'] != 200) $this->exception($pay_config['msg']);
- $ret_data['config'] = $pay_config['config'];
- break;
- case 4:
- $notify_url = $this->request->root(true) . '/api/Alipay/LevelOrderNotify';
- $config = Alipay::ali_pay('订单支付',$pay_no,$order_info['price_total'],$notify_url);
- $ret_data['config']['ali_url'] = $config;
- $ret_data['ali_url'] = $config;
- break;
- case 5 :
- if(!$user_info['openid']) $this->exception('请绑定openid');
- $notify_url = $this->request->root(true) . '/api/we_chat_pay/LevelOrderNotify';
- $pay_config = WeChatPay::wxPay('订单支付',$pay_no,$order_info['price_total'],$notify_url,'JSAPI',$user_info['openid']);
- if($pay_config['code'] != 200) $this->exception($pay_config['msg']);
- $ret_data['config'] = $pay_config['config'];
- break;
- }
- Db::commit();
- }catch (\Exception $e){
- $this->is_commit = false;
- $this->ret_msg = $e->getMessage();
- Db::rollback();
- }
- $this->transReturn($ret_data);
- }
- /**
- * @title 开通会员
- * @desc 开通会员
- * @author qc
- * @url /api/Level_order/payOrderNew
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:level_id type:int require:1 default:0 desc:会员等级
- * @param name:level_key type:int require:1 default:0 desc:等级价格的key值
- * @param name:pay_type type:int require:1 default:0 desc:支付方式(1.h5微信,2.h5支付宝,3.app微信,4.app支付宝,5.h5微信内支付,6微信pc,7pc支付宝)
- * @return name:config type:array default:0 desc:支付配置
- * @return name:config.appId type:string default:-- desc:公众账号ID
- * @return name:config.signType type:string default:-- desc:签名类型
- * @return name:config.paySign type:string default:-- desc:签名
- * @return name:config.nonceStr type:string default:-- desc:随机字符串
- * @return name:config.timestamp type:string default:-- desc:时间戳
- * @return name:config.partnerid type:string default:-- desc:商户号
- * @return name:config.prepayid type:string default:-- desc:唯一支付号
- * @return name:config.package type:string default:-- desc:package
- * @return name:config.mch_id type:string default:-- desc:商户号(H5)
- * @return name:config.pay_no type:string default:-- desc:订单支付号(H5)
- * @return name:config.notify_url type:string default:-- desc:回调地址(H5)
- * @return name:config.total_fee type:int default:-- desc:支付金额(分!!!)
- * @return name:config.ali_url type:int default:-- desc:支付宝支付链接
- * @return name:code_url type:string default:-- desc:付款码url
- * @return name:openid type:string default:-- desc:openid
- */
- public function payOrderNew()
- {
- $level_id = input('post.level_id');
- $level_key = input('post.level_key');
- $pay_type = input('post.pay_type',1);
- $user_info = User::where('id',$this->user_id)->find();
- if($user_info['account_type'] == 1 && $user_info['is_first'] == 0) $this->error('请联系公司管理员进行会员开通');
- $is_renew = \app\common\model\LevelOrder::where('user_id',$this->user_id)->where('status',1)->where('pay_state',1)->count();
- $level_set = UserLevel::where('id', $level_id)->find()->toArray();
- if (!$level_set['price']) $this->error('会员价格设置有误');
- $level_price = json_decode($level_set['price'], true);
- if (!isset($level_price[$level_key])) $this->error('会员价格设置有误.');
- //$price_total = $is_renew && $level_price[$level_key]['renew'] > 0 && $level_price[$level_key]['renew'] ? bcmul( $level_price[$level_key]['price'], $level_price[$level_key]['renew']/100,2) : $level_price[$level_key]['price'];
- $order_insert = [
- 'user_id' => $this->user_id,
- 'order_no' => get_order_sn(),
- 'level_id' => $level_id,
- 'level_key' => $level_key,
- 'pay_type' => $pay_type,
- 'month' => $level_price[$level_key]['time'],
- 'level_title' => $level_price[$level_key]['title'],
- 'price_total' =>$is_renew ? $level_price[$level_key]['renew'] : $level_price[$level_key]['price'],
- 'pay_no' =>get_order_sn()
- ];
- $user_vip = UserLevelRank::getUserVipInfo($this->user_id);
- if(!empty($user_vip) && $user_vip['level_id'] > 1) $this->error('已是会员,请联系平台');
- if(!empty($user_vip) && $user_vip['user_id'] != $this->user_id) $this->error('请联系已绑定企业账号');
- if(!empty($user_vip)) {
- $cal_time = strtotime('+'.$order_insert['month'] .' month',$user_vip['end_time']);
- if($cal_time > strtotime('+3 years')) $this->error('会员续费期限最多3年');
- }
- $order_info = LOM::create($order_insert);
- $order_info = $order_info->toArray();
- $pay_no = $order_info['pay_no'];
- $ret_data = ['pay_status'=>0,'config'=>[],'code_url'=>'','openid'=>$user_info['openid'],'order_id'=>$order_info['id']];
- Db::startTrans();
- try {
- switch ($pay_type){
- case 1://微信
- $notify_url = $this->request->root(true) . '/api/we_chat_pay/LevelOrderNotify';
- $pay_config = WeChatPay::wxPay('订单支付',$pay_no,$order_info['price_total'],$notify_url,'MWEB');
- if($pay_config['code'] != 200) $this->exception($pay_config['msg']);
- $pay_config['config']['mch_id'] = config('app.wx_pay')['mch_id'];
- $pay_config['config']['pay_no'] = $pay_no;
- $pay_config['config']['notify_url'] = $notify_url;
- $pay_config['config']['mweb_url'] = $pay_config['mweb_url'];
- $pay_config['config']['total_fee'] = $order_info['price_total'] * 100;
- $ret_data['config'] = $pay_config['config'];
- break;
- case 2 :
- $notify_url = $this->request->root(true) . '/api/Alipay/LevelOrderNotify';
- $return_url ='https://'.$_SERVER['HTTP_HOST']."/dist/#/my";
- $config = Alipay::ali_pay_h5('订单支付',$pay_no,$order_info['price_total'],$notify_url,$return_url);
- $ret_data['config']['ali_url'] = $config;
- $ret_data['ali_url'] = $config;
- break;
- case 3:
- $notify_url = $this->request->root(true) . '/api/we_chat_pay/LevelOrderNotify';
- $pay_config = WeChatPay::wxPay('订单支付',$pay_no,$order_info['price_total'],$notify_url,'APP');
- if($pay_config['code'] != 200) $this->exception($pay_config['msg']);
- $ret_data['config'] = $pay_config['config'];
- break;
- case 4:
- $notify_url = $this->request->root(true) . '/api/Alipay/LevelOrderNotify';
- $config = Alipay::ali_pay('订单支付',$pay_no,$order_info['price_total'],$notify_url);
- $ret_data['config']['ali_url'] = $config;
- $ret_data['ali_url'] = $config;
- break;
- case 5 :
- if(!$user_info['openid']) $this->exception('请绑定openid');
- $notify_url = $this->request->root(true) . '/api/we_chat_pay/LevelOrderNotify';
- $pay_config = WeChatPay::wxPay('订单支付',$pay_no,$order_info['price_total'],$notify_url,'NATIVE',$user_info['openid']);
- if($pay_config['code'] != 200) $this->exception($pay_config['msg']);
- $ret_data['config'] = $pay_config['config'];
- break;
- case 6:
- $notify_url = $this->request->root(true) . '/api/we_chat_pay/LevelOrderNotify';
- /*$app = Factory::payment(config('app.wx_pay'));
- $pay_config = $app->order->unify([
- 'body' => '订单支付',
- 'out_trade_no' => $pay_no,
- 'total_fee' => $order_info['price_total']*100,
- 'notify_url' => $notify_url, // 支付结果通知网址,如果不设置则会使用配置里的默认地址
- 'trade_type' => 'NATIVE', // 请对应换成你的支付方式对应的值类型
- ]);*/
- $pay_config = WeChatPay::wxPay('订单支付',$pay_no,$order_info['price_total'] ,$notify_url,'NATIVE');
- $ret_data['config'] = $pay_config['config'];
- $ret_data['code_url'] = $pay_config['pc_pay_url'];
- break;
- case 7:
- $notify_url = $this->request->root(true) . '/api/Alipay/LevelOrderNotify';
- $return_url ='https://'.$_SERVER['HTTP_HOST']."/pc/#/vip-member";
- $config = Alipay::ali_pay_pc('订单支付',$pay_no,$order_info['price_total'],$notify_url,$return_url);
- $ret_data['config']['ali_url'] = $config;
- $ret_data['ali_url'] = $config;
- break;
- }
- Db::commit();
- }catch (\Exception $e){
- $this->is_commit = false;
- $this->ret_msg = $e->getMessage();
- Db::rollback();
- }
- $this->transReturn($ret_data);
- }
- /**
- * @title 获取订单列表
- * @desc 获取订单列表
- * @author qc
- * @method GET
- * @url /api/Level_order/getOrderList
- * @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:price_total type:float default:-- desc:待支付金额
- * @return name:level_id type:float default:-- desc:等级id
- * @return name:level_name type:float default:-- desc:等级名称
- * @return name:level_title type:float default:-- desc:等级标题
- * @return name:month type:float default:-- desc:时长(月)
- * @return name:pay_state type:int default:-- desc:支付状态(0未支付1已支付)
- * @return name:bill_apply type:int default:-- desc:是否申请发票【0否1是】
- * @return name:create_at type:string default:-- desc:时间
- * @return name:level_logo type:string default:-- desc:等级LOGO
- * @return name:pay_type type:int default:-- desc:支付方式(1.h5微信,2.h5支付宝,3.app微信,4.app支付宝,5.h5微信内支付,6微信pc)
- * @return name:bill_info type:array default:-- desc:发票详情
- */
- public function getOrderList()
- {
- $field = 'id,level_id,level_key,month,price_total,pay_type,order_no,create_at,level_title';
- $list = \app\common\model\LevelOrder::field($field)->where(['user_id'=>$this->user_id,'pay_state'=>1])
- ->order('id desc ')->limit($this->off_set,$this->page_num)->select()->toArray();
- array_walk($list,function (&$v){
- $v['bill_apply'] = BillApply::checkBillApply($v['id'],1) ? 1 : 0;
- $level_info = UserLevel::where('id',$v['level_id'])->find()->toArray();
- $v['level_name'] =$level_info['name'];
- $v['level_logo'] =$level_info['logo'];
- $bill_info = BillApply::where(['order_type'=>1,'order_id'=>$v['id']])
- ->alias('b')->field('b.id,b.type,b.header,b.status,b.email,b.phone,b.bill_img,b.bill_time,b.remark,identify_number,b.create_at,t.title type_title,a.price_total money')
- ->leftJoin('BillType t','t.id = b.type')
- ->leftJoin('LevelOrder a','a.id = b.order_id')
- ->find();
- if($bill_info) $bill_info = $bill_info->toArray();
- $v['bill_info'] = $bill_info;
- });
- $total_num = \app\common\model\LevelOrder::field($field)->where(['user_id'=>$this->user_id,'pay_state'=>1])->count();
- $this->success('ok',['list'=>$list,'total_num'=>numTransform($total_num),'total_count'=>$total_num,'page_num'=>$this->page_num]);
- }
- /**
- *
- * @title 申请开票
- * @desc 申请开票
- * @author qc
- * @method POST
- * @url /api/Level_order/applyBill
- * @header name:Authorization require:1 desc:Token
- * @param name:order_id type:string default:1 desc:订单id
- * @param name:type type:int default:-- desc:类型id
- * @param name:header type:string default:-- desc:抬头名称[公司名称||个人名称]
- * @param name:identify_number type:string default:-- desc:纳税人识别号
- * @param name:email type:string default:-- desc:邮箱
- * @param name:remark type:string default:-- desc:备注
- */
- public function applyBill()
- {
- $order_id = input('post.order_id');
- /* $type = input('post.type');
- $header = input('post.header');
- $identify_number = input('post.identify_number');
- $address = input('post.address');
- $bank = input('post.bank');
- $card_no = input('post.card_no');
- $remark = input('post.remark');
- $phone = input('post.phone');
- $email = input('post.email');*/
- $post = input('post.');
- $order_info = \app\common\model\LevelOrder::where('id',$order_id)->find()->toArray();
- if(!$order_info['pay_state'])$this->error('订单未支付');
- if(BillApply::checkBillApply($order_id,1)) $this->error('已申请开票');
- $ret_val = UserSynth::buildBillApply($this->user_id, $order_id, 1,$post,0,1,$post['remark']);
- if($ret_val['code'] != 200) $this->error($ret_val['msg']);
- $this->success('申请成功');
- }
- /**
- * @title 获取发票详情
- * @desc 获取发票详情
- * @author qc
- * @url /api/Level_order/getBillInfo
- * @method GET
- * @param name:id type:int require default:-- desc:订单id
- * @return name:id type:array default:-- desc:票详情id
- * @return name:header type:string default:0 desc:抬头
- * @return name:type_title type_title:int default:0 desc:发票类型
- * @return name:email type:string default:0 desc:邮箱
- * @return name:create_at type:string default:0 desc:申请时间
- * @return name:phone type:string default:0 desc:电话
- * @return name:status type:int default:0 desc:状态(0申请中1已开票2已完成)
- * @return name:identify_number type:string default:0 desc:纳税人识别号
- * @return name:send_type type:string default:1 desc:1点子发票2纸质发票
- * @return name:remark type:string default:0 desc:备注
- * @return name:bill_img type:string default:0 desc:点子发票【图片】
- * @return name:bill_time type:string default:0 desc:开票时间
- *
- */
- public function getBillInfo()
- {
- $info = BillApply::where(['order_type'=>1,'order_id'=>input('get.id')])
- ->alias('b')->field('b.id,b.type,b.header,b.status,b.email,b.phone,b.bill_img,b.bill_time,b.remark,identify_number,b.create_at,t.title type_title,a.price_total money')
- ->leftJoin('BillType t','t.id = b.type')
- ->leftJoin('LevelOrder a','a.id = b.order_id')
- ->find();
- if(empty($info)) $this->error('该订单未申请发票');
- $info = $info->toArray();
- $this->success('ok',['detail'=>$info]);
- }
- }
|