|
@@ -450,17 +450,19 @@ class OrderService implements OrderServiceInterface
|
|
|
|
|
|
$start = Carbon::parse($data['starttime']);
|
|
$start = Carbon::parse($data['starttime']);
|
|
$end = Carbon::parse($data['endtime']);
|
|
$end = Carbon::parse($data['endtime']);
|
|
- $status = [
|
|
|
|
- 0 => '1',
|
|
|
|
- 1 => '4',
|
|
|
|
- 2 => '6',
|
|
|
|
- ];
|
|
|
|
- //订单状态:1:通过;2:驳回;3:撤回;4:修改;5:过期;6:待审核;7:结束
|
|
|
|
|
|
+ // $status = [
|
|
|
|
+ // 0 => '1',
|
|
|
|
+ // 1 => '7',
|
|
|
|
+ // 2 => '6',
|
|
|
|
+ // ];
|
|
|
|
+ //订单状态:1:通过;2:驳回;3:撤回;5:过期;6:待审核;7:结束
|
|
|
|
+ // 筛选已上架的广告有时间冲突的广告位
|
|
$ads = Ad::where('fromtime', '<=', $start)->where('totime', '>=', $end)->select('pid')->get()->all();
|
|
$ads = Ad::where('fromtime', '<=', $start)->where('totime', '>=', $end)->select('pid')->get()->all();
|
|
- $orderads = OrderAd::where('fromtime', '<=', $start)->where('totime', '>=', $end)->whereIn('status', $status)->select('pid')->get()->all();
|
|
|
|
|
|
+ $orderads = OrderAd::where('fromtime', '<=', $start)->where('totime', '>=', $end)->where('status', 1)->select('pid')->get()->all();
|
|
$ads = array_column($ads, 'pid');
|
|
$ads = array_column($ads, 'pid');
|
|
$orderads = array_column($orderads, 'pid');
|
|
$orderads = array_column($orderads, 'pid');
|
|
$pids = array_merge($ads, $orderads);
|
|
$pids = array_merge($ads, $orderads);
|
|
|
|
+
|
|
var_dump($pids, '-----------1-------------');
|
|
var_dump($pids, '-----------1-------------');
|
|
//取出pid
|
|
//取出pid
|
|
$ad_pids = array_unique($pids);
|
|
$ad_pids = array_unique($pids);
|