|
@@ -516,7 +516,14 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
->where('ad.fromtime', '<=', $now)
|
|
|
->where('ad.totime', '>=', $now);
|
|
|
})
|
|
|
- ->select("ad_place.*",'ad.*',"ad_place.id as ad_place_id","ad.name as ad_name")
|
|
|
+ ->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);
|
|
@@ -2045,6 +2052,7 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
* */
|
|
|
public function getWebsiteParentCategory(array $data): array
|
|
|
{
|
|
|
+
|
|
|
if (isset($data['website_id']) && !empty($data['website_id'])) {
|
|
|
$website = Website::where('id', $data['website_id'])->where('status', 1)->first();
|
|
|
}
|
|
@@ -2056,19 +2064,8 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
|
|
|
$category['parent'] = WebsiteCategory::where('website_id', $data['website_id'])
|
|
|
->where('pid', 0)
|
|
|
- ->select('aLIas_pinyin', 'category_id', 'alias')
|
|
|
+ ->selectRaw("category_id as cid, alias as name, CONCAT('/', '', aLIas_pinyin, '/') as path")
|
|
|
->get()
|
|
|
- ->map(function ($item) {
|
|
|
- $result = [
|
|
|
- 'name' => $item->alias,
|
|
|
- 'cid' => $item->category_id
|
|
|
- ];
|
|
|
- if (!empty($item->aLIas_pinyin)) {
|
|
|
- $result['path'] = "/{$item->aLIas_pinyin}/";
|
|
|
- }
|
|
|
- return $result;
|
|
|
- })
|
|
|
- ->values()
|
|
|
->all();
|
|
|
|
|
|
|
|
@@ -2094,21 +2091,6 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
return $result;
|
|
|
})->values()->all();
|
|
|
|
|
|
- $foot = FooterCategory::where('website_id', $data['website_id'])
|
|
|
- ->get();
|
|
|
- $category['foot'] = $foot->map(function ($item) {
|
|
|
- $name = $item->name;
|
|
|
- $id = $item->id;
|
|
|
- $alias_pinyin = $item->name_pinyin;
|
|
|
- $result = [
|
|
|
- 'name' => $name,
|
|
|
- 'cid' => $id
|
|
|
- ];
|
|
|
- if (!empty($alias_pinyin)) {
|
|
|
- $result['path'] = "/{$alias_pinyin}/";
|
|
|
- }
|
|
|
- return $result;
|
|
|
- })->values()->all();
|
|
|
|
|
|
|
|
|
|