|
@@ -80,8 +80,11 @@ class Notify extends Api
|
|
Db::rollback();
|
|
Db::rollback();
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
$ros = Db::name('pay_order')->where(['out_trade_no' => $out_trade_no])->update(['order_status'=>1,'notifytime'=>time()]);
|
|
$ros = Db::name('pay_order')->where(['out_trade_no' => $out_trade_no])->update(['order_status'=>1,'notifytime'=>time()]);
|
|
if($ros === false) {
|
|
if($ros === false) {
|
|
@@ -94,6 +97,75 @@ class Notify extends Api
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function recharge($user_id,$gold,$payorder_id){
|
|
|
|
+
|
|
|
|
+ $userinfo = Db::name('user')->field('id,username,group_id,intro_uid,gender')->where('id',$user_id)->find();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if(empty($userinfo['intro_uid']) || $userinfo['group_id'] == 3 || $userinfo['gender'] == 0){
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $intro_userinfo = Db::name('user')->field('id,username,group_id,intro_uid,gender')->where('id',$userinfo['intro_uid'])->find();
|
|
|
|
+ if(empty($intro_userinfo)){return true;}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ bcscale(1);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if($intro_userinfo['group_id'] == 3){
|
|
|
|
+
|
|
|
|
+ $recharge_b2a_rate = config('site.recharge_b2a_rate');
|
|
|
|
+ $jewel = bcdiv(bcmul($gold,$recharge_b2a_rate),100);
|
|
|
|
+
|
|
|
|
+ $result = model('Wallet')->lockChangeAccountRemain($intro_userinfo['id'],'jewel',$jewel,41, $userinfo['username'].'充值','pay_order',$payorder_id);
|
|
|
|
+ if($result['status']===false)
|
|
|
|
+ {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if($intro_userinfo['group_id'] == 2){
|
|
|
|
+ $recharge_c2b_rate = config('site.recharge_c2b_rate');
|
|
|
|
+ $jewel = bcdiv(bcmul($gold,$recharge_c2b_rate),100);
|
|
|
|
+
|
|
|
|
+ $result = model('Wallet')->lockChangeAccountRemain($intro_userinfo['id'],'jewel',$jewel,41, $userinfo['username'].'充值','pay_order',$payorder_id);
|
|
|
|
+ if($result['status']===false)
|
|
|
|
+ {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $intro_intro_userinfo = Db::name('user')->field('id,username,group_id,intro_uid,gender')->where('id',$intro_userinfo['intro_uid'])->find();
|
|
|
|
+ if(empty($intro_intro_userinfo)){return true;}
|
|
|
|
+
|
|
|
|
+ if($intro_intro_userinfo['group_id'] == 3){
|
|
|
|
+
|
|
|
|
+ $recharge_b2a_rate = config('site.recharge_b2a_rate');
|
|
|
|
+ $jewel = bcdiv(bcmul($jewel,$recharge_b2a_rate),100);
|
|
|
|
+
|
|
|
|
+ $result = model('Wallet')->lockChangeAccountRemain($intro_intro_userinfo['id'],'jewel',$jewel,41, $userinfo['username'].'充值','pay_order',$payorder_id);
|
|
|
|
+ if($result['status']===false)
|
|
|
|
+ {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
public function vip_notify_base(){
|
|
public function vip_notify_base(){
|