|
@@ -6578,10 +6578,11 @@ class NewsService implements NewsServiceInterface
|
|
|
// return Result::success($catiall);
|
|
|
foreach($categorys as $key => $val){
|
|
|
if(isset($val['level'][0]) && !empty($val['level'][0])){
|
|
|
- $level = $val['level'][0];
|
|
|
- $imgnum = $val['level'][1] ?? null;
|
|
|
- $textnum = $val['level'][2] ?? null;
|
|
|
- if(!empty($textnum) && $textnum > 0){
|
|
|
+ $level = explode(',', $val['level'])[0];
|
|
|
+ $imgnum = explode(',', $val['level'])[1] ?? null;
|
|
|
+ $textnum = explode(',', $val['level'])[2] ?? null;
|
|
|
+ if($level == 1){
|
|
|
+ if(!empty($textnum) && $textnum > 0){
|
|
|
$text_num = Project::where('level', $level)
|
|
|
->where('website_id',$data['website_id'])
|
|
|
->where('status',1)
|
|
@@ -6590,19 +6591,43 @@ class NewsService implements NewsServiceInterface
|
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit($textnum)
|
|
|
->get()->all();
|
|
|
- }
|
|
|
- if(!empty($imgnum) && $imgnum > 0){
|
|
|
- $img_num = Project::where('level', $level)
|
|
|
- ->where('website_id',$data['website_id'])
|
|
|
+ }
|
|
|
+ if(!empty($imgnum) && $imgnum > 0){
|
|
|
+ $img_num = Project::where('level', $level)
|
|
|
+ ->where('website_id',$data['website_id'])
|
|
|
+ ->where('status',1)
|
|
|
+ ->where('imgurl','!=', '')
|
|
|
+ ->whereNotNull('imgurl')
|
|
|
+ ->select('project.id','project.title','project.description','project.updated_at',
|
|
|
+ 'project.imgurl as imgs','project.category_id','project.cat_arr_id')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit($imgnum)
|
|
|
+ ->get()->all();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(!empty($textnum) && $textnum > 0){
|
|
|
+ $text_num = Project::where('website_id',$data['website_id'])
|
|
|
->where('status',1)
|
|
|
- ->where('imgurl','!=', '')
|
|
|
- ->whereNotNull('imgurl')
|
|
|
->select('project.id','project.title','project.description','project.updated_at',
|
|
|
- 'project.imgurl as imgs','project.category_id','project.cat_arr_id')
|
|
|
+ 'project.category_id','project.cat_arr_id','project.website_id','project.updated_at',
|
|
|
+ 'project.created_at')
|
|
|
->orderBy('updated_at', 'desc')
|
|
|
- ->limit($imgnum)
|
|
|
+ ->limit($textnum)
|
|
|
->get()->all();
|
|
|
+ }
|
|
|
+ if(!empty($imgnum) && $imgnum > 0){
|
|
|
+ $img_num = Project::where('website_id',$data['website_id'])
|
|
|
+ ->where('status',1)
|
|
|
+ ->where('imgurl','!=', '')
|
|
|
+ ->whereNotNull('imgurl')
|
|
|
+ ->select('project.id','project.title','project.description','project.updated_at',
|
|
|
+ 'project.imgurl as imgs','project.category_id','project.cat_arr_id')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit($imgnum)
|
|
|
+ ->get()->all();
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
if(isset($val['id'][0]) && !empty($val['id'][0])){
|
|
|
$category_ids = explode(',', $val['id'])[0];
|