Przeglądaj źródła

传输字段修改

duqinya 6 lat temu
rodzic
commit
59a725cc31

+ 1 - 2
app/Http/Controllers/CmsContentTemplateSetController.php

@@ -52,8 +52,7 @@ class CmsContentTemplateSetController extends BaseController
     public function productList(Request $request)
     {
         $validator = Validator::make($request->all(), [
-            'id' => 'required|integer',
-            'area_type' => 'required|string',
+            'subject_id' => 'required|integer',
         ]);
         if ($validator->fails()) {
             return $this->jsonError($validator->errors()->first());

+ 1 - 12
app/Repositories/CmsContentTemplateSetRepository.php

@@ -145,21 +145,10 @@ class CmsContentTemplateSetRepository
 
     public function productList($request)
     {
-        $area_type = '';
-        if ($request['area_type'] == 'floor') {
-            $area_type = 2;
-        }
-        $template_set = $this->cmsContentTemplateSet->select('rule')->where(['area_type' => $area_type, 'id' => $request['id']])->first();
-        if (!$template_set) {
-            throw new HttpException(500, '没有找到对应模板内容');
-        }
-        $template_array = json_decode($template_set->rule, true);
-
-        $product = $this->cmsSubjectProduct->where('subject_id', $template_array['link_url'])->orderBy('sort', 'asc')->get();
+        $product = $this->cmsSubjectProduct->where('subject_id', $request['subject_id'])->orderBy('sort', 'asc')->get();
         $pro_array = $product->toArray();
         $res_id = implode(",", array_column($pro_array, 'product_id'));
 
-
         try {
             $sign = generateSign(['ids' => $res_id], config('customer.app_secret'));
             $url = config("customer.app_service_url") . '/product/homeProduct';