Compare commits
No commits in common. "d9eb6a72e04ea7924ca4fdc819baaae08e2efdc9" and "6e87eb7162b5ea16b398c20fc6b8b8b55bf07269" have entirely different histories.
d9eb6a72e0
...
6e87eb7162
|
|
@ -4,7 +4,6 @@ namespace App\Http\Controllers\Api\Customer;
|
||||||
|
|
||||||
use App\Model\Lq\JclqOdds;
|
use App\Model\Lq\JclqOdds;
|
||||||
use App\Model\Lq\JclqResult;
|
use App\Model\Lq\JclqResult;
|
||||||
use App\Model\Zq\BjdcOdds;
|
|
||||||
use App\Model\Zq\JczqOdds;
|
use App\Model\Zq\JczqOdds;
|
||||||
use App\Model\Zq\JczqResult;
|
use App\Model\Zq\JczqResult;
|
||||||
use App\Utils\Helps;
|
use App\Utils\Helps;
|
||||||
|
|
@ -133,67 +132,4 @@ class MatchController extends BaseController
|
||||||
'result' => $doing->merge($will)->merge($done)
|
'result' => $doing->merge($will)->merge($done)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @api {POST} /api/customer/match/bjdc 比分-北京单场
|
|
||||||
* @apiVersion 0.1.0
|
|
||||||
* @apiGroup 客户端
|
|
||||||
*
|
|
||||||
* @apiParam {String} [date] 日期
|
|
||||||
*
|
|
||||||
* @apiSuccessExample {json} 返回结果
|
|
||||||
* {
|
|
||||||
* "code": 200,
|
|
||||||
* "message": "",
|
|
||||||
* "data": {
|
|
||||||
* "dates": [{ // 用户信息
|
|
||||||
* "date": 2,
|
|
||||||
* "date_str": 1,
|
|
||||||
* "week_str": "13511111111"
|
|
||||||
* }],
|
|
||||||
* "result" :[{ // 比赛信息
|
|
||||||
* }],
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
public function bjdc(Request $request)
|
|
||||||
{
|
|
||||||
$date = $request->input('date');
|
|
||||||
|
|
||||||
$startDate = date('Ymd', strtotime('-30 day'));
|
|
||||||
$endDate = date('Ymd', strtotime('+7 day'));
|
|
||||||
|
|
||||||
$dates = [];
|
|
||||||
for ($d = $startDate; $d <$endDate; $d = date('Ymd', strtotime('+1 day', strtotime($d)))) {
|
|
||||||
$dates[] = [
|
|
||||||
'date' => date('Y-m-d', strtotime($d)),
|
|
||||||
'date_str' => date('m-d', strtotime($d)),
|
|
||||||
'week_str' => Helps::getWeek($d),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if (!$date) {
|
|
||||||
$date = date('Y-m-d');
|
|
||||||
}
|
|
||||||
|
|
||||||
$jczq = BjdcOdds::with([ 'score', 'match'])
|
|
||||||
->select([
|
|
||||||
DB::raw('bjdc_odds.*'),
|
|
||||||
DB::raw('zq_match.status as match_status')
|
|
||||||
])
|
|
||||||
->leftJoin('zq_match', 'zq_match.match_id', 'bjdc_odds.match_id')
|
|
||||||
->where('zq_match.start_time', '>=' , date('Y-m-d 00:00:00', strtotime($date)))
|
|
||||||
->where('zq_match.start_time', '<' , date('Y-m-d 00:00:00', strtotime('+1 day', strtotime($date))))
|
|
||||||
->orderBy('zq_match.start_time', 'asc')
|
|
||||||
->get();
|
|
||||||
|
|
||||||
$doing = collect($jczq)->where('match_status', 1)->collect();
|
|
||||||
$will = collect($jczq)->where('match_status', 0)->collect();
|
|
||||||
$done = collect($jczq)->whereNotIn('match_status', [1,0])->collect();
|
|
||||||
|
|
||||||
return $this->jsonSuccess([
|
|
||||||
'dates' => $dates,
|
|
||||||
'result' => $doing->merge($will)->merge($done)
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -253,11 +253,10 @@ class ReportController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = Order::select([
|
$query = Order::select([
|
||||||
DB::raw('sum(IF(type = 3, union_money, money)) as money'),
|
DB::raw('sum(money) as money'),
|
||||||
DB::raw('count(*) as count'),
|
DB::raw('count(*) as count'),
|
||||||
'lottery_type_id',
|
'lottery_type_id',
|
||||||
])
|
])
|
||||||
->usable()
|
|
||||||
->where('draft_shop_id', $this->shopId());
|
->where('draft_shop_id', $this->shopId());
|
||||||
|
|
||||||
if ($dateStart) {
|
if ($dateStart) {
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,6 @@ class BjdcOdds extends BaseModel
|
||||||
return $query->where('sale_state', SaleState::Selling);
|
return $query->where('sale_state', SaleState::Selling);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function score() {
|
|
||||||
return $this->belongsTo(JczqScore::class, 'match_id', 'match_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function match() {
|
|
||||||
return $this->belongsTo(ZqMatch::class, 'match_id', 'match_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getCloseTime($earlySecond)
|
public function getCloseTime($earlySecond)
|
||||||
{
|
{
|
||||||
$time = strtotime($this->close_time);
|
$time = strtotime($this->close_time);
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ return [
|
||||||
'driver' => 'redis',
|
'driver' => 'redis',
|
||||||
'connection' => 'default',
|
'connection' => 'default',
|
||||||
'queue' => env('REDIS_QUEUE', 'default'),
|
'queue' => env('REDIS_QUEUE', 'default'),
|
||||||
'retry_after' => 600,
|
'retry_after' => 90,
|
||||||
'block_for' => null,
|
'block_for' => null,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ Route::middleware(['log', 'app', 'api'])
|
||||||
|
|
||||||
Route::get('match/jczq', 'MatchController@jczq');
|
Route::get('match/jczq', 'MatchController@jczq');
|
||||||
Route::get('match/lq', 'MatchController@lq');
|
Route::get('match/lq', 'MatchController@lq');
|
||||||
Route::get('match/bjdc', 'MatchController@bjdc');
|
|
||||||
|
|
||||||
Route::get('jczq/selling', 'JczqController@selling');
|
Route::get('jczq/selling', 'JczqController@selling');
|
||||||
Route::post('jczq/valid', 'JczqController@valid');
|
Route::post('jczq/valid', 'JczqController@valid');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue