|
@@ -21,7 +21,8 @@ class StoreGp extends BaseModel
|
|
|
try {
|
|
|
$no = intval(self::value('max(no)') ?: 0) + 1;
|
|
|
$rs = self::getpath($no);
|
|
|
- list($p_no, $no_path,$gp_id) = [$rs['p_no'],$rs['no_path'],$rs['gp_id']];
|
|
|
+ list($p_no, $no_path,$gp_id,$send,$gpinfo) = [$rs['p_no'],$rs['no_path'],$rs['gp_id'],$rs['send'],$rs['info']];
|
|
|
+ @file_put_contents("job.txt","\r\n".json_encode($rs),8);
|
|
|
$order_id = $order['id'];
|
|
|
$add_time = time();
|
|
|
$price = $order['total_price'];
|
|
@@ -36,7 +37,16 @@ class StoreGp extends BaseModel
|
|
|
$spuser = User::where('uid',$user['spread_uid'])->find();
|
|
|
User::where('uid',$order['uid'])->update(['cycle_time'=>strtotime("+31 day")]);
|
|
|
User::where('uid',$spuser['uid'])->update(['cycle_time'=>strtotime("+31 day")]);
|
|
|
-
|
|
|
+ if($send==1)
|
|
|
+ {
|
|
|
+ $p_user = User::find($gpinfo['uid']);
|
|
|
+ $sp_brokeragePrice1 = 3000;
|
|
|
+ $gp_balance = bcadd($p_user['gp_now_money'], $sp_brokeragePrice1, 2);
|
|
|
+ $mark = "公排号:" . $no . "满3个加报单余额3000元,订单号:" . $order['order_id'];
|
|
|
+ $res = UserBill::income('满3个报单余额', $p_user['uid'], 'now_money', 'brokerage', $sp_brokeragePrice1, $order['id'], $gp_balance, $mark, 1);
|
|
|
+ User::where('uid', $p_user['uid'])->inc('gp_now_money', $sp_brokeragePrice1)->update();
|
|
|
+ self::where('no', $p_no)->update(['send'=>1]);
|
|
|
+ }
|
|
|
$p_no_cts = self::where('no', $gp_id)->value('team_cts');
|
|
|
if ($p_no_cts>0 && $p_no_cts % 3 == 0) {
|
|
|
$info = self::where('no', $gp_id)->find();
|
|
@@ -48,11 +58,7 @@ class StoreGp extends BaseModel
|
|
|
$balance = bcadd($sp_userInfo['brokerage_price'], $sp_brokeragePrice, 2);
|
|
|
$mark = "公排号:" . $no . "满3个拥金3000元,订单号:" . $order['order_id'];
|
|
|
$res = UserBill::income('满3个拥金', $sp_userInfo['uid'], 'now_money', 'brokerage', $sp_brokeragePrice, $order['id'], $balance, $mark, 1);
|
|
|
- $sp_brokeragePrice1 = 3000;
|
|
|
- $gp_balance = bcadd($sp_userInfo['gp_now_money'], $sp_brokeragePrice1, 2);
|
|
|
- $mark = "公排号:" . $no . "满3个加报单余额3000元,订单号:" . $order['order_id'];
|
|
|
- $res = UserBill::income('满3个报单余额', $sp_userInfo['uid'], 'now_money', 'brokerage', $sp_brokeragePrice1, $order['id'], $gp_balance, $mark, 1);
|
|
|
- User::where('uid', $sp_userInfo['uid'])->inc('brokerage_price', $sp_brokeragePrice)->inc('gp_now_money', $sp_brokeragePrice1)->update();
|
|
|
+ User::where('uid', $sp_userInfo['uid'])->inc('brokerage_price', $sp_brokeragePrice)->update();
|
|
|
break;
|
|
|
case 6:
|
|
|
case 9:
|
|
@@ -119,7 +125,7 @@ class StoreGp extends BaseModel
|
|
|
*/
|
|
|
private static function getpath($no)
|
|
|
{
|
|
|
- $no_path = [];$p_no=0;
|
|
|
+ $no_path = [];$p_no=0;$send = 0;$info = null;
|
|
|
if($no==1) {
|
|
|
$no_path[] =1;
|
|
|
$gp_id = 1;
|
|
@@ -131,9 +137,14 @@ class StoreGp extends BaseModel
|
|
|
$p_no = $min['no'];
|
|
|
$no_path = explode(",",$min['no_path']);
|
|
|
$no_path[] = $no;
|
|
|
+ if($min['cts']==2)
|
|
|
+ {
|
|
|
+ $send = 1;
|
|
|
+ }
|
|
|
+ $info = $min;
|
|
|
}
|
|
|
$no_path = join(",",$no_path);
|
|
|
- return compact('p_no','no_path','gp_id');
|
|
|
+ return compact('p_no','no_path','gp_id','send','info');
|
|
|
|
|
|
}
|
|
|
}
|