正在显示
1 个修改的文件
包含
13 行增加
和
6 行删除
@@ -301,7 +301,10 @@ class Wechat extends Api | @@ -301,7 +301,10 @@ class Wechat extends Api | ||
301 | $out_trade_no = $order_no; | 301 | $out_trade_no = $order_no; |
302 | $o_w["order_no"] = $out_trade_no; | 302 | $o_w["order_no"] = $out_trade_no; |
303 | $order_info = Db::name('verification_order')->where($o_w)->find(); | 303 | $order_info = Db::name('verification_order')->where($o_w)->find(); |
304 | - $total_fee = $order_info['price'] = mt_rand(100,120);//测试支付1分钱 | 304 | + $total_fee = $order_info['price'] * 100; |
305 | + //测试支付 | ||
306 | + $total_fee = mt_rand(100,120);//测试支付1分钱 | ||
307 | + //测试结束 | ||
305 | $app = WehcatModule::getInstance()->initWechatPay(); | 308 | $app = WehcatModule::getInstance()->initWechatPay(); |
306 | $result = $app->order->unify([ | 309 | $result = $app->order->unify([ |
307 | 'body' => '优惠券购买', | 310 | 'body' => '优惠券购买', |
@@ -451,21 +454,25 @@ class Wechat extends Api | @@ -451,21 +454,25 @@ class Wechat extends Api | ||
451 | // 发放佣金 企业付款到零钱 | 454 | // 发放佣金 企业付款到零钱 |
452 | public function grant_commission($pid=0,$order_id=0){ | 455 | public function grant_commission($pid=0,$order_id=0){ |
453 | //测试 https://coupon.xp.yn.cn/api/v1/wechat/grant_commission | 456 | //测试 https://coupon.xp.yn.cn/api/v1/wechat/grant_commission |
454 | - $order_id = 14; | 457 | + //$order_id = 14; |
455 | try{ | 458 | try{ |
456 | $send_result = 0; | 459 | $send_result = 0; |
457 | $verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find(); | 460 | $verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find(); |
458 | $verification_store = Db::name('verification_store')->where(['id'=>$verification_order['verification_store_id']])->find(); | 461 | $verification_store = Db::name('verification_store')->where(['id'=>$verification_order['verification_store_id']])->find(); |
462 | + //测试发送红包 开始 | ||
463 | + $pid = 2; | ||
464 | + $verification_store['commission'] = mt_rand(100,111)/100; | ||
465 | + //测试结束 | ||
459 | $user_info = Db::name('user')->where(['id'=>$pid])->find(); | 466 | $user_info = Db::name('user')->where(['id'=>$pid])->find(); |
460 | 467 | ||
461 | if(!empty($verification_store['commission'])){ | 468 | if(!empty($verification_store['commission'])){ |
462 | $app = WehcatModule::getInstance()->initWechatPay(); | 469 | $app = WehcatModule::getInstance()->initWechatPay(); |
463 | $result = $app->transfer->toBalance([ | 470 | $result = $app->transfer->toBalance([ |
464 | - 'partner_trade_no' => '168532907259455', // 商户订单号,需保持唯一性(只能是字母或者数字,不能包含有符号) | ||
465 | - 'openid' => 'o5OQw6PPEGaHqIjAir7gqeDV5MzQ', | 471 | + 'partner_trade_no' => $verification_order['order_no'], // 商户订单号,需保持唯一性(只能是字母或者数字,不能包含有符号) |
472 | + 'openid' => $user_info['openid'], | ||
466 | 'check_name' => 'NO_CHECK', // NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 | 473 | 'check_name' => 'NO_CHECK', // NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 |
467 | - 're_user_name' => '陈程', // 如果 check_name 设置为FORCE_CHECK,则必填用户真实姓名 | ||
468 | - 'amount' => 1, // 企业付款金额,单位为分 | 474 | + 're_user_name' => $user_info['nickname'], // 如果 check_name 设置为FORCE_CHECK,则必填用户真实姓名 |
475 | + 'amount' =>$verification_store['commission']*100 , // 企业付款金额,单位为分 | ||
469 | 'desc' => '分销佣金', // 企业付款操作说明信息。必填 | 476 | 'desc' => '分销佣金', // 企业付款操作说明信息。必填 |
470 | ]); | 477 | ]); |
471 | 478 |
-
请 注册 或 登录 后发表评论