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

Merge branch 'master' of http://47.118.43.255:3000/jjhc/jucai

linwu 3 лет назад
Родитель
Сommit
24482c3549

+ 3 - 0
app/Http/Controllers/Jkq/HomeController.php

@@ -63,6 +63,9 @@ class HomeController extends JkqBaseController
      */
     private function _dealCompany()
     {
+        $seatmeal_companies = $this->companyService->getCompaniesByConditions(['subsite_id' => 14],20);
+        return json_encode($seatmeal_companies,JSON_UNESCAPED_UNICODE+JSON_UNESCAPED_SLASHES);
+        dd($seatmeal_companies);
         //公司信息
         $seatmeal_companies = [];
         $seatmeal_arr       = ['14', '11', '26,27,28', '13,35,153', '25', '3,4,6,9,10,16,17,20,21,25,28,30,31,34,36,37,40,41,44,45,151,165,213,314'];

+ 48 - 0
app/Services/Company/CompanyService.php

@@ -1651,6 +1651,54 @@ class CompanyService
         return $list;
     }
 
+    /**
+     * 根据查询条件获取企业
+     * @param $where
+     * @param int $limit
+     */
+    public function getCompaniesByConditions($where,$limit = 10){
+        if ($limit > 20) {
+            $limit = 20;
+        }
+        $order = 'real_refreshtime desc,id desc';
+        $field = '*,if(refresh_time>UNIX_TIMESTAMP(NOW()),(refresh_time-100000000),refresh_time) as real_refreshtime';
+        //处理trade
+        $map = array();
+        $map[] = array('subsite_id', '=', $where['subsite_id']);
+        $result = $this->companyRepository->getTradeCompanies($map, [], $field, $order, $limit);
+        $job_where = array(
+            array('valid', '=', 1),
+            array('display', '=', 1),
+        );
+        if (config('aix.companyset.comset.show_set.jobs_display') == 1) {
+            $job_where[] = array('audit', '=', 1);
+        } else {
+            $job_where[] = array('audit', '<>', 3);
+        }
+        $order_by = array('refresh_time' => 'desc');
+        if ($result->toArray()) {
+            $result = $result->toArray();
+            foreach ($result as $key => $value) {
+                $result[$key]['companyname'] = $value['companyname'];
+                $result[$key]['refreshtime_cn'] = $value['refresh_time'] > time() ? daterange(time(), $value['real_refreshtime']) : daterange(time(), $value['refresh_time']);
+                $result[$key]['url'] = route(url_rewrite('AIX_companyshow'), array('id' => $value['id']));
+                $result[$key]['comjobs_url'] = route('jobs.company.jobs', array('id' => $value['id']));
+                $result[$key]['briefly'] = strip_tags($value['contents']);
+                if ($value['logo']) {
+                    $result[$key]['logo'] = upload_asset($value['logo']);
+                } else {
+                    $result[$key]['logo'] = public_data_path('data/upload/no_logo.png');
+                }
+                $job_where_in = array('company_id'=>array($value['id']));
+                $jobs_list = $this->jobsRepository->getCompanyJobs($job_where, $job_where_in, $order_by,16);
+                $result[$key]['jobs'] = $jobs_list->toArray();
+
+                //$list[] = $row;
+            }
+        }
+        return $result;
+    }
+
     //获取企业在招职位
     public function getCompanyValidJobs($company_id)
     {

+ 16 - 54
public/themes/default/views/jkq/index.blade.php

@@ -80,16 +80,9 @@
         <div class="jkq_title body_box mt30">
             <div>名企招聘</div>
         </div>
-        <img class="enterprise_poster body_box mt20" src="{{theme_asset('app/images/jkq/index_poster.jpg')}}" alt="">
-        <div class="body_box enterprise_category mt30" v-if="enterprise_category_real.length > 0">
-            <template v-for="(value,index) in enterprise_category_real" v-key="index">
-                <span :class="enterprise_index == value.index ? 'on' : ''" @click="select_enterprise(value.index)"><a href="javascript:void(0)">@{{ value.name }}</a></span>
-                <el-divider v-if="index + 1 != enterprise_category_real.length" direction="vertical"></el-divider>
-            </template>
-        </div>
-        <div class="enterprise_list body_box mt10" v-if="enterprise_category_real.length > 0">
+        <div class="enterprise_list body_box mt10">
             <el-row :gutter="30">
-                <el-col v-for="(value,index) in enterprise_list[enterprise_index]" v-key="index" class="mt20" :span="12">
+                <el-col v-for="(value,index) in enterprise_list" v-key="index" class="mt20" :span="12">
                     <el-card class="box-card">
                         <el-row>
                             <el-col :span="7">
@@ -101,14 +94,17 @@
                             <el-col class="enterprise_information" :span="17">
                                 <h2 class="nowrap"><a :href="'/jkq/content/jobs/company?id='+value.id">@{{value.companyname}}</a></h2>
                                 <p v-if="value.jobs.length == 0">暂无职位</p>
-                                <p>
-                                    <a :href="'/jkq/content/jobs/show?id='+value.jobs[0].id" v-if="value.jobs[0]">@{{ value.jobs[0].jobs_name }}(@{{ value.jobs[0].amount }})</a>
-                                    &nbsp;&nbsp;<a :href="'/jkq/content/jobs/show?id='+value.jobs[1].id" v-if="value.jobs[1]">@{{ value.jobs[1].jobs_name }}(@{{ value.jobs[1].amount }})</a>
-                                </p>
-                                <p>
-                                    <a :href="'/jkq/content/jobs/show?id='+value.jobs[2].id" v-if="value.jobs[2]">@{{ value.jobs[2].jobs_name }}(@{{ value.jobs[2].amount }})</a>
-                                    &nbsp;&nbsp;<a :href="'/jkq/content/jobs/show?id='+value.jobs[3].id" v-if="value.jobs[3]">@{{ value.jobs[3].jobs_name }}(@{{ value.jobs[3].amount }})</a>
-                                </p>
+                                <div v-else>
+                                    <p>
+                                        <a :href="'/jkq/content/jobs/show?id='+value.jobs[0].id" v-if="value.jobs[0]">@{{ value.jobs[0].jobs_name }}(@{{ value.jobs[0].amount }})</a>
+                                        &nbsp;&nbsp;<a :href="'/jkq/content/jobs/show?id='+value.jobs[1].id" v-if="value.jobs[1]">@{{ value.jobs[1].jobs_name }}(@{{ value.jobs[1].amount }})</a>
+                                    </p>
+                                    <p>
+                                        <a :href="'/jkq/content/jobs/show?id='+value.jobs[2].id" v-if="value.jobs[2]">@{{ value.jobs[2].jobs_name }}(@{{ value.jobs[2].amount }})</a>
+                                        &nbsp;&nbsp;<a :href="'/jkq/content/jobs/show?id='+value.jobs[3].id" v-if="value.jobs[3]">@{{ value.jobs[3].jobs_name }}(@{{ value.jobs[3].amount }})</a>
+                                    </p>
+                                </div>
+
                             </el-col>
                         </el-row>
                     </el-card>
@@ -161,55 +157,21 @@
             el: '#app',
             data: {
                 search_value:'',
-                enterprise_category:[{
-                    id:1,
-                    name:"纺织服装",
-                },{
-                    id:2,
-                    name:"制鞋",
-                },{
-                    id:3,
-                    name:"陶瓷建材",
-                },{
-                    id:4,
-                    name:"食品饮料",
-                },{
-                    id:5,
-                    name:"纸制品及包装印刷",
-                },{
-                    id:6,
-                    name:"其他",
-                }],
-                enterprise_index:0,
                 enterprise_list:{!! $seatmeal_companies !!}
             },
             created(){
-                for (var i = 0; i < this.enterprise_category.length; i++) {
-                    if (this.enterprise_list[i].length > 0) {
-                        this.enterprise_index = i;
-                        return false;
-                    }
-                }
+
             },
             methods: {
                 search(){
                     location.href = "{{route('jkq.jobs')}}?key=" + this.search_value;
                 },
                 select_enterprise(index) {
-                    this.enterprise_index = index;
+                    //this.enterprise_index = index;
                 }
             },
             computed: {
-                enterprise_category_real () {
-                    const list = [];
-                    this.enterprise_category.forEach((value,key)=>{
-                        if (this.enterprise_list[key].length > 0) {
-                            value.index = key;
-                            list.push(value);
-                        }
-                    });
-                    return list;
-                }
+
             }
         })
         jQuery(".picScroll-left").slide({