|
@@ -613,17 +613,27 @@ class WebsiteService implements WebsiteServiceInterface
|
|
public function getWebsiteModelCategory(array $data): array
|
|
public function getWebsiteModelCategory(array $data): array
|
|
{
|
|
{
|
|
$website_id=[
|
|
$website_id=[
|
|
- 'website_id' => $data['website_id']
|
|
|
|
|
|
+ 'website_category.website_id' => $data['website_id']
|
|
];
|
|
];
|
|
$placeid=$data['placeid']-1;
|
|
$placeid=$data['placeid']-1;
|
|
$pid=[
|
|
$pid=[
|
|
- 'pid' => $data['pid'],
|
|
|
|
|
|
+ 'website_category.pid' => $data['pid'],
|
|
];
|
|
];
|
|
|
|
+ var_dump( "=======",$pid);
|
|
$num = $data['num'];
|
|
$num = $data['num'];
|
|
- $result=WebsiteCategory::where($website_id)->where($pid)->withCount(['children' => function ($query) use ($website_id) {
|
|
|
|
|
|
+ // return Result::success($data);
|
|
|
|
+ $result=WebsiteCategory::where($website_id)
|
|
|
|
+ ->leftJoin("category",'website_category.category_id','category.id')
|
|
|
|
+ ->select('website_category.*','category.is_url','category.web_url')
|
|
|
|
+ ->where($pid)
|
|
|
|
+ ->withCount(['children' => function ($query) use ($website_id) {
|
|
$query->where($website_id);
|
|
$query->where($website_id);
|
|
- }])->orderBy('sort')->offset($placeid)->limit($num)->get();
|
|
|
|
-
|
|
|
|
|
|
+ }])
|
|
|
|
+ ->orderBy('website_category.sort')
|
|
|
|
+
|
|
|
|
+ ->offset($placeid)
|
|
|
|
+ ->limit($num)->get();
|
|
|
|
+ return Result::success($result);
|
|
if(!empty($result)){
|
|
if(!empty($result)){
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}else{
|
|
}else{
|