...
|
...
|
@@ -498,13 +498,14 @@ class Wechat extends Api |
|
|
public function grant_red_packets($pid=0,$order_id=0){
|
|
|
try{
|
|
|
//测试 https://coupon.xp.yn.cn/api/v1/wechat/grant_red_packets
|
|
|
//$order_id = 14;
|
|
|
|
|
|
$order_id = 58;
|
|
|
$pid = 2;
|
|
|
//测试结束
|
|
|
$send_result = 0;
|
|
|
$verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find();
|
|
|
$verification_store = Db::name('verification_store')->where(['id'=>$verification_order['verification_store_id']])->find();
|
|
|
$user_info = Db::name('user')->where(['id'=>$pid])->find();
|
|
|
$total_amount = $verification_store['commission'] = 100;
|
|
|
$total_amount = $verification_store['commission'] * 100;
|
|
|
$app = WehcatModule::getInstance()->initWechatPay();
|
|
|
$result = $app->redpack->sendNormal([
|
|
|
'mch_billno' => $verification_order['order_no'],
|
...
|
...
|
|