|
@@ -519,27 +519,27 @@ class WebsiteService implements WebsiteServiceInterface
|
|
$where[] = ['ad_place.ad_tag', 'like', '%' . $data['ad_tag'] . '%'];
|
|
$where[] = ['ad_place.ad_tag', 'like', '%' . $data['ad_tag'] . '%'];
|
|
// return Result::success($where);
|
|
// return Result::success($where);
|
|
$result = AdPlace::where($where)
|
|
$result = AdPlace::where($where)
|
|
- ->leftJoin("ad", function ($join) use ($now) {
|
|
|
|
- $join->on("ad.pid", "=", "ad_place.id")
|
|
|
|
- ->where('ad.status', 1)
|
|
|
|
- ->where('ad.fromtime', '<=', $now)
|
|
|
|
- ->where('ad.totime', '>=', $now);
|
|
|
|
- })
|
|
|
|
- ->select(
|
|
|
|
- 'ad_place.name as place_name',
|
|
|
|
- 'ad_place.thumb',
|
|
|
|
- 'ad_place.ad_tag',
|
|
|
|
- 'ad.name as ad_name',
|
|
|
|
- 'ad.image_src',
|
|
|
|
- 'ad.image_url',
|
|
|
|
- 'ad.image_alt'
|
|
|
|
- )
|
|
|
|
- ->get()->all();
|
|
|
|
- if (empty($result)) {
|
|
|
|
- return Result::error("此广告位不存在!", 0);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- return Result::error("请选择广告位!", 0);
|
|
|
|
|
|
+ ->leftJoin("ad", function ($join) use ($now) {
|
|
|
|
+ $join->on("ad.pid", "=", "ad_place.id")
|
|
|
|
+ ->where('ad.status', 1)
|
|
|
|
+ ->where('ad.fromtime', '<=', $now)
|
|
|
|
+ ->where('ad.totime', '>=', $now);
|
|
|
|
+ })
|
|
|
|
+ ->select(
|
|
|
|
+ 'ad_place.name as place_name',
|
|
|
|
+ 'ad_place.thumb',
|
|
|
|
+ 'ad_place.ad_tag',
|
|
|
|
+ 'ad_place.introduce',
|
|
|
|
+ 'ad.name as ad_name',
|
|
|
|
+ 'ad.image_src',
|
|
|
|
+ 'ad.image_url',
|
|
|
|
+ 'ad.image_alt')
|
|
|
|
+ ->get()->all();
|
|
|
|
+ if(empty($result)){
|
|
|
|
+ return Result::error("此广告位不存在!",0);
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ return Result::error("请选择广告位!",0);
|
|
}
|
|
}
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|