作者 chencheng

0601-3

@@ -166,6 +166,7 @@ class Client extends Base @@ -166,6 +166,7 @@ class Client extends Base
166 */ 166 */
167 public function orderinfo(){ 167 public function orderinfo(){
168 $order_id=$this->postParam['id']; 168 $order_id=$this->postParam['id'];
  169 +
169 $where['a.id']=$order_id; 170 $where['a.id']=$order_id;
170 $where['a.user_id']=$this->auth->id; 171 $where['a.user_id']=$this->auth->id;
171 $verification_store_id=$this->store_id; 172 $verification_store_id=$this->store_id;
@@ -498,13 +498,14 @@ class Wechat extends Api @@ -498,13 +498,14 @@ class Wechat extends Api
498 public function grant_red_packets($pid=0,$order_id=0){ 498 public function grant_red_packets($pid=0,$order_id=0){
499 try{ 499 try{
500 //测试 https://coupon.xp.yn.cn/api/v1/wechat/grant_red_packets 500 //测试 https://coupon.xp.yn.cn/api/v1/wechat/grant_red_packets
501 - //$order_id = 14;  
502 - 501 + $order_id = 58;
  502 + $pid = 2;
  503 + //测试结束
503 $send_result = 0; 504 $send_result = 0;
504 $verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find(); 505 $verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find();
505 $verification_store = Db::name('verification_store')->where(['id'=>$verification_order['verification_store_id']])->find(); 506 $verification_store = Db::name('verification_store')->where(['id'=>$verification_order['verification_store_id']])->find();
506 $user_info = Db::name('user')->where(['id'=>$pid])->find(); 507 $user_info = Db::name('user')->where(['id'=>$pid])->find();
507 - $total_amount = $verification_store['commission'] = 100; 508 + $total_amount = $verification_store['commission'] * 100;
508 $app = WehcatModule::getInstance()->initWechatPay(); 509 $app = WehcatModule::getInstance()->initWechatPay();
509 $result = $app->redpack->sendNormal([ 510 $result = $app->redpack->sendNormal([
510 'mch_billno' => $verification_order['order_no'], 511 'mch_billno' => $verification_order['order_no'],