|
@@ -2533,14 +2533,19 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
{
|
|
|
// return Result::success($data);
|
|
|
$where = [];
|
|
|
- if(isset($data['keyword']) &&!empty($data['keyword'])){
|
|
|
- $where = ['img_alias' => $data['keyword'],'name' => ['like', '%'. $data['keyword']. '%']];
|
|
|
+ if(isset($data['img_alias']) &&!empty($data['img_alias'])){
|
|
|
+ array_push($where, ['img_alias', 'like', '%'. $data['img_alias']. '%']);
|
|
|
}
|
|
|
if(isset($data['type']) &&!empty($data['type'])){
|
|
|
- $where = ['type' => $data['type']];
|
|
|
+ array_push($where, ['type', '=', $data['type']]);
|
|
|
}
|
|
|
- if(isset($data['website_id']) &&!empty($data['website_id'])){
|
|
|
- $where = ['website_id' => $data['website_id']];
|
|
|
+ if(isset($data['website_name']) &&!empty($data['website_name'])){
|
|
|
+ $website = Website::where('website_name','like','%'.$data['website_name'].'%')->first();
|
|
|
+ if(empty($website)){
|
|
|
+ return Result::error("没有查找到相关数据", 0);
|
|
|
+ }else{
|
|
|
+ array_push($where, ['website_id', '=', $website['id']]);
|
|
|
+ }
|
|
|
}
|
|
|
// return Result::success($where);
|
|
|
$query = WebsiteImg::when(!empty($where), function ($query) use ($where) {
|
|
@@ -2567,8 +2572,8 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
// $file = $data['img_url']->file('image');
|
|
|
// $size = $file->getSize();
|
|
|
$img_data = [
|
|
|
- 'website_id' => $data['website_id'],
|
|
|
- 'img_alias' => $data['img_alias'],
|
|
|
+ 'website_id' => $data['website_id'] ?? 0,
|
|
|
+ 'img_alias' => $data['img_alias'] ?? '',
|
|
|
'img_url' => $data['img_url'],
|
|
|
'img_size' => $data['img_size'],
|
|
|
];
|
|
@@ -2621,20 +2626,5 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
}
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
- /**
|
|
|
- * 获取网站模板下的板块信息
|
|
|
- * @param array $data
|
|
|
- */
|
|
|
- public function getStaticResourceInfo(array $data): array
|
|
|
- {
|
|
|
- $where = [
|
|
|
- 'id' => $data['id'],
|
|
|
- ];
|
|
|
- $result = WebsiteImg::where($where)->first();
|
|
|
- if (empty($result)) {
|
|
|
- return Result::error("没有查找到相关数据", 0);
|
|
|
- }
|
|
|
- return Result::success($result);
|
|
|
- }
|
|
|
// --自助建站-----------20250522fr----------------------end
|
|
|
}
|