Просмотр исходного кода

wesmiler 更新加盟信息地区搜索判断

wesmiler 5 лет назад
Родитель
Сommit
2c9ad48d3c

+ 3 - 3
app/index/controller/IndexController.php

@@ -60,8 +60,8 @@ class IndexController extends HomeBaseController
         $brand6 = JiamengService::getListByLevel(6, 10);
 
         // 品牌聚焦
-        $brand7 = JiamengService::getListByLevel(7, 42);
-        $brand7 = $brand7? array_chunk($brand7->toArray(), 21, true) : [];
+        $brand7 = JiamengService::getListByLevel(7, 56);
+        $brand7 = $brand7? array_chunk($brand7->toArray(), 28, true) : [];
 
         // 最新品牌
         $brand8 = JiamengService::getNewList(12);
@@ -112,7 +112,7 @@ class IndexController extends HomeBaseController
 //        $answerList = NewsService::getListByLevel(1, 13);
 
         // 课堂列表
-        $courseList = NewsService::getListByLevel(1, 7);
+        $courseList = NewsService::getListByLevel(1, 8);
 
         // 参数
         $cateList = CategoryService::getCates();

+ 5 - 0
app/index/controller/JiamengController.php

@@ -324,6 +324,11 @@ class JiamengController extends HomeBaseController
             exit;
         }
 
+        if(isset($param['jm_title']) && empty($param['jm_title'])){
+            $this->error('请填写项目名称');
+            exit;
+        }
+
         if(isset($param['tzed']) && $param['tzed']<=0){
             $this->error('请选择投资额度');
             exit;

+ 3 - 1
app/index/service/JiamengService.php

@@ -116,7 +116,9 @@ class JiamengService
                 $aid = isset($param['aid']) ? intval($param['aid']) : -1;
                 $aid = $aid>0? $aid : (isset($param['area_id']) ? intval($param['area_id']) : -1);
                 if ($aid > 0) {
-                    $query->where(['j.area_id' => $aid]);
+                    $query->where(function($query) use ($aid){
+                        $query->where(['j.area_id' => $aid])->whereOr(['j.area_id'=> 0]);
+                    });
                 }
             })
             ->order('j.update_time desc, j.create_time desc, j.list_order')

+ 1 - 1
public/themes/mjmls/index/index/floor/join.html

@@ -12,7 +12,7 @@
                         <foreach name="$brand7" id="brands">
                         <div class="swiper-slide">
                             <foreach name="brands" id="v">
-                            <a href="/b{$v.id}/" target="_blank" title="{$v.title}"><img data-src="{:cmf_get_image_preview_url($v.logo)}" onerror="imageError(this)" alt="{$v.title}"></a>
+                            <a href="/b{$v.id}/" target="_blank" title="{$v.title}"><img data-src="{:cmf_get_image_preview_url($v.logo)}" onerror="imageError(this)" alt="{$v.title}" width="90" height="67.5"></a>
                             </foreach>
                         </div>
                         </foreach>