|
@@ -39,12 +39,14 @@ class OrderService implements OrderServiceInterface
|
|
|
$pids = array_merge($ads, $orderads);
|
|
|
$ad_pids = array_unique($pids);
|
|
|
|
|
|
+
|
|
|
if (!empty($ad_pids)) {
|
|
|
$pid = [];
|
|
|
foreach ($ad_pids as $val) {
|
|
|
array_push($pid, $val['pid']);
|
|
|
}
|
|
|
$placeids = AdPlace::whereNotIn('id', $pid)->where($where)->select('id')->get()->all();
|
|
|
+
|
|
|
|
|
|
$place_id = [];
|
|
|
foreach ($placeids as $val) {
|
|
@@ -391,23 +393,26 @@ class OrderService implements OrderServiceInterface
|
|
|
1 => '4',
|
|
|
2 => '6',
|
|
|
];
|
|
|
+
|
|
|
$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();
|
|
|
$pids = array_merge($ads, $orderads);
|
|
|
$ad_pids = array_unique($pids);
|
|
|
+
|
|
|
if (!empty($ad_pids)) {
|
|
|
$pid = [];
|
|
|
foreach ($ad_pids as $val) {
|
|
|
array_push($pid, $val['pid']);
|
|
|
}
|
|
|
$placeids = AdPlace::whereNotIn('id', $pid)->where($where)->select('id', 'website_id')->get()->all();
|
|
|
-
|
|
|
+
|
|
|
if (!isset($data['website_id'])) {
|
|
|
$website_id = [];
|
|
|
foreach ($placeids as $v) {
|
|
|
array_push($website_id, $v['website_id']);
|
|
|
}
|
|
|
$result = Website::whereIn('id', $website_id)->get();
|
|
|
+
|
|
|
} else {
|
|
|
$place_id = [];
|
|
|
foreach ($placeids as $val) {
|
|
@@ -429,8 +434,10 @@ class OrderService implements OrderServiceInterface
|
|
|
'rows' => $rep->toArray(),
|
|
|
'count' => $count,
|
|
|
];
|
|
|
+
|
|
|
}
|
|
|
} else {
|
|
|
+
|
|
|
if (isset($data['website_id'])) {
|
|
|
$rep = AdPlace::where($where)
|
|
|
->where('ad_place.website_id', $data['website_id'])
|