|
|
@@ -509,7 +509,6 @@ class User extends BaseModel
|
|
|
if (!count($userStair)) return [];
|
|
|
if ($grade == 0) return self::getUserSpreadCountList(implode(',', $userStair), $orderBy, $keyword, $page, $limit);
|
|
|
$userSecondary = self::where('spread_uid', 'in', implode(',', $userStair))->column('uid');
|
|
|
- halt(self::getUserSpreadCountList(implode(',', $userSecondary), $orderBy, $keyword, $page, $limit));
|
|
|
return self::getUserSpreadCountList(implode(',', $userSecondary), $orderBy, $keyword, $page, $limit);
|
|
|
}
|
|
|
|
|
|
@@ -531,13 +530,13 @@ class User extends BaseModel
|
|
|
->where('o.is_del', 0)->where('o.is_system_del', 0)->alias('o')->fetchSql(true)->select();
|
|
|
$model = $model->join("(" . $sql . ") p", 'u.uid = p.uid', 'LEFT');
|
|
|
$model = $model->where('u.uid', 'IN', $uid);
|
|
|
- $model = $model->field("u.uid,u.nickname,u.phone,from_unixtime(u.add_time,'%Y/%m/%d') as time,u.spread_count as childCount,u.pay_count as orderCount,p.numberCount,u.account");
|
|
|
+ $model = $model->field("u.uid,u.nickname,u.phone,u.avatar,from_unixtime(u.add_time,'%Y/%m/%d') as time,u.spread_count as childCount,u.pay_count as orderCount,p.numberCount");
|
|
|
if (strlen(trim($keyword))) $model = $model->where('u.nickname|u.phone', 'like', "%$keyword%");
|
|
|
$model = $model->group('u.uid');
|
|
|
$model = $model->order($orderBy);
|
|
|
$model = $model->page($page, $limit);
|
|
|
$list = $model->select();
|
|
|
- if ($list) return $list;
|
|
|
+ if ($list) return $list->toArray();
|
|
|
else return [];
|
|
|
}
|
|
|
|
|
|
@@ -748,10 +747,13 @@ class User extends BaseModel
|
|
|
{
|
|
|
$auction = Auction::where('rend_time','<', date('H:i:s'))->select();
|
|
|
foreach ($auction as $key => $value) {
|
|
|
- $auctionPush = AuctionPush::where('auction_id', '=',$value['id'])->where('add_time', '=', strtotime(date('Y-m-d', time())))->find();
|
|
|
- if (!$auctionPush){
|
|
|
- AuctionPush::beginTrans();
|
|
|
+ $auctionPush = AuctionPush::where('auction_id', '=',$value['id'])->where('add_time', '=', strtotime(date('Y-m-d', time())))->count();
|
|
|
+ if ($auctionPush < 1){
|
|
|
if (strtotime($value['rend_time'])+1800 <= time()){
|
|
|
+ AuctionPush::create([
|
|
|
+ 'auction_id' => $value['id'],
|
|
|
+ 'add_time' => strtotime(date('Y-m-d', time()))
|
|
|
+ ]);
|
|
|
//当前场次结束半个小时
|
|
|
$order = AuctionOrder::alias('a')
|
|
|
->field('a.*')
|
|
|
@@ -763,7 +765,7 @@ class User extends BaseModel
|
|
|
$user = User::where('uid', $v['uid'])->find();
|
|
|
if ($user['spread_uid']){
|
|
|
$spread = User::where('uid', $user['spread_uid'])->find();
|
|
|
- $bo = AuctionOrder::where('uid', $spread['uid'])->where('auction_id', $value['id'])->where('status', 2)->count();
|
|
|
+ $bo = AuctionOrder::where('uid', $spread['uid'])->where('auction_id', $value['id'])->where('frequency', $value['frequency'])->where('status', 2)->count();
|
|
|
if ($bo > 0){
|
|
|
$money = round($v['price'] * 0.003, 2);
|
|
|
$spread['sp_final'] += $money;
|
|
|
@@ -773,21 +775,13 @@ class User extends BaseModel
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- try {
|
|
|
- AuctionPush::create([
|
|
|
- 'auction_id' => $value['id'],
|
|
|
- 'add_time' => strtotime(date('Y-m-d', time()))
|
|
|
- ]);
|
|
|
- AuctionPush::commitTrans();
|
|
|
- } catch (\Exception $e) {
|
|
|
- AuctionPush::rollbackTrans();
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 分红奖励
|
|
|
* @return void
|
|
|
@@ -866,9 +860,9 @@ class User extends BaseModel
|
|
|
}
|
|
|
foreach ($userDow as $dk => $dv){
|
|
|
//查询出下级每个分支昨天流水多少
|
|
|
- $money = AuctionOrder::where('uid', $dk)->where('status',2)->sum('price');
|
|
|
+ $money = AuctionOrder::where('uid', $dk)->where('status',2)->where('create_time', '>', $time)->sum('price');
|
|
|
if ($dv){
|
|
|
- $money += AuctionOrder::where('uid', 'in', $dv)->where('status', '=', 2)->sum('price');
|
|
|
+ $money += AuctionOrder::where('uid', 'in', $dv)->where('status', '=', 2)->where('create_time', '>', $time)->sum('price');
|
|
|
}
|
|
|
$moneys[$dk] = $money; // 查询到支线下级总额度
|
|
|
}
|