|
@@ -963,7 +963,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
{
|
|
{
|
|
$where = [];
|
|
$where = [];
|
|
if (isset($data['template_class_id']) && !empty($data['template_class_id'])) {
|
|
if (isset($data['template_class_id']) && !empty($data['template_class_id'])) {
|
|
- $where['template_class.template_class_id'] = $data['template_class_id'];
|
|
|
|
|
|
+ $where['template.template_class_id'] = $data['template_class_id'];
|
|
}
|
|
}
|
|
if (isset($data['template_id']) && !empty($data['template_id'])) {
|
|
if (isset($data['template_id']) && !empty($data['template_id'])) {
|
|
array_push($where, ['template.template_id', $data['template_id']]);
|
|
array_push($where, ['template.template_id', $data['template_id']]);
|
|
@@ -980,14 +980,15 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
}else{
|
|
}else{
|
|
$size_id = [];
|
|
$size_id = [];
|
|
}
|
|
}
|
|
- $result = Sector::where($where)
|
|
|
|
- ->when(!empty($size_id), function ($query) use ($size_id) {
|
|
|
|
|
|
+ $result = Sector::when(!empty($size_id), function ($query) use ($size_id) {
|
|
$query->whereIn('size_id', $size_id);
|
|
$query->whereIn('size_id', $size_id);
|
|
})
|
|
})
|
|
->leftJoin('size', 'size.id', '=', 'sector.size_id')
|
|
->leftJoin('size', 'size.id', '=', 'sector.size_id')
|
|
->leftJoin('template', 'template.template_id', '=', 'sector.template_id')
|
|
->leftJoin('template', 'template.template_id', '=', 'sector.template_id')
|
|
->leftJoin('template_class', 'template_class.class_id', '=', 'template.template_class_id')
|
|
->leftJoin('template_class', 'template_class.class_id', '=', 'template.template_class_id')
|
|
|
|
+ ->where($where)
|
|
->select('sector.*', 'size.width','size.height','template_class.name as class_name','template.template_name')
|
|
->select('sector.*', 'size.width','size.height','template_class.name as class_name','template.template_name')
|
|
|
|
+
|
|
->orderBy('sector.id', 'desc')
|
|
->orderBy('sector.id', 'desc')
|
|
->paginate($data['page_size'], ['*'], 'page', $data['page']);
|
|
->paginate($data['page_size'], ['*'], 'page', $data['page']);
|
|
if(empty($result)){
|
|
if(empty($result)){
|