|
@@ -72,6 +72,14 @@ class BetService extends BaseService
|
|
|
if (isset($search['status']) && !empty($search['status'])) {
|
|
if (isset($search['status']) && !empty($search['status'])) {
|
|
|
$where[] = ['status', '=', $search['status']];
|
|
$where[] = ['status', '=', $search['status']];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (isset($search['start_time']) && !empty($search['status'])) {
|
|
|
|
|
+ $where[] = ['created_at', '>=', "{$search['start_time']} 00:00:00"];
|
|
|
|
|
+ $where[] = ['created_at', '<=', "{$search['end_time']} 23:59:59"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
return $where;
|
|
return $where;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -103,7 +111,16 @@ class BetService extends BaseService
|
|
|
public static function paginate(array $search = [])
|
|
public static function paginate(array $search = [])
|
|
|
{
|
|
{
|
|
|
$limit = isset($search['limit']) ? $search['limit'] : 15;
|
|
$limit = isset($search['limit']) ? $search['limit'] : 15;
|
|
|
- $paginator = self::model()::where(self::getWhere($search))->paginate($limit);
|
|
|
|
|
|
|
+ $query = self::model()::where(self::getWhere($search));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (isset($search['username']) && !empty($search['username'])) {
|
|
|
|
|
+ $username = $search['username'];
|
|
|
|
|
+ $query = $query->whereHas('user', function ($query) use ($username) {
|
|
|
|
|
+ $query->where('username', $username);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ $paginator = $query->paginate($limit);
|
|
|
return ['total' => $paginator->total(), 'data' => $paginator->items()];
|
|
return ['total' => $paginator->total(), 'data' => $paginator->items()];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -275,7 +292,7 @@ class BetService extends BaseService
|
|
|
// WalletService::updateBalance($memberId,$rebateAmount);
|
|
// WalletService::updateBalance($memberId,$rebateAmount);
|
|
|
|
|
|
|
|
// $walletInfo = WalletService::findOne(['member_id' => $memberId]);
|
|
// $walletInfo = WalletService::findOne(['member_id' => $memberId]);
|
|
|
- // $balance = $walletInfo['available_balance'];
|
|
|
|
|
|
|
+ // $balance = $walletInfo['available_balance'];
|
|
|
|
|
|
|
|
// BalanceLogService::addLog($memberId,$rebateAmount,$balance,($balance+$rebateAmount),'返水',$bet_id,'');
|
|
// BalanceLogService::addLog($memberId,$rebateAmount,$balance,($balance+$rebateAmount),'返水',$bet_id,'');
|
|
|
// }
|
|
// }
|
|
@@ -315,7 +332,7 @@ class BetService extends BaseService
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
$betFake = Config::where('field', 'bet_fake')->first()->val;
|
|
$betFake = Config::where('field', 'bet_fake')->first()->val;
|
|
|
- if($betFake){
|
|
|
|
|
|
|
+ if ($betFake) {
|
|
|
// 期数验证
|
|
// 期数验证
|
|
|
$issueInfo = IssueService::model()::where('status', IssueService::model()::STATUS_BETTING)->orderBy('id', 'desc')->first();
|
|
$issueInfo = IssueService::model()::where('status', IssueService::model()::STATUS_BETTING)->orderBy('id', 'desc')->first();
|
|
|
if ($issueInfo) {
|
|
if ($issueInfo) {
|
|
@@ -360,7 +377,7 @@ class BetService extends BaseService
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -446,13 +463,13 @@ class BetService extends BaseService
|
|
|
$text = "历史注单 \n";
|
|
$text = "历史注单 \n";
|
|
|
$text .="中奖总金额:{$total_amount} \n";
|
|
$text .="中奖总金额:{$total_amount} \n";
|
|
|
foreach ($list as $k => $v) {
|
|
foreach ($list as $k => $v) {
|
|
|
- if($v->status == self::model()::STATUS_SETTLED){
|
|
|
|
|
|
|
+ if ($v->status == self::model()::STATUS_SETTLED) {
|
|
|
$phase = $v->profit - $v->amount;
|
|
$phase = $v->profit - $v->amount;
|
|
|
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
$phase = '待开奖';
|
|
$phase = '待开奖';
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$text .= "-------------------------------------\n";
|
|
$text .= "-------------------------------------\n";
|
|
|
$text .= "期数:{$v->issue_no} \n";
|
|
$text .= "期数:{$v->issue_no} \n";
|
|
|
$text .= "内容:{$v->keywords} \n";
|
|
$text .= "内容:{$v->keywords} \n";
|