Exemplo n.º 1
0
 public function index($cid)
 {
     $company = $this->company($cid, $this->list['func']['url']);
     $companyModel = CompanyModel::find($company['cid']);
     $result = ['datas' => $this->query($company['cid']), 'company' => $companyModel, 'comMain' => $this->getComMain($company['cid']), 'topmenus' => $this->topmenus, 'prefix_url' => $this->prefix_url];
     return view('company.recruit.index', $result);
 }
Exemplo n.º 2
0
 public function company($cid, $url)
 {
     //判断cid
     if (!$cid && !\Session::has('user.cid')) {
         echo "<script>alert('参数错误,或者没有权限!');history.go(-1);</script>";
         exit;
     } elseif ($cid && !\Session::has('user.cid')) {
         $this->cid = $cid;
         $this->company = CompanyModel::find($cid);
         $this->userid = $this->company->uid;
     } elseif ((!$cid || $cid) && \Session::has('user.cid')) {
         $this->userid = \Session::get('user.uid');
         $this->cid = \Session::get('user.cid');
         $this->company = unserialize(\Session::get('user.company'));
     }
     define('CID', $this->cid);
     //公司页面访问日志刷新频率
     $comMain = ComMainModel::where('cid', $this->cid)->first();
     define('VISITRATE', $comMain->visitRate);
     $this->getComModules($this->cid);
     $this->topmenus = LinkModel::where('cid', $this->cid)->where('type_id', 2)->where('isshow', 1)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate(8);
     //拼接url
     if ($url) {
         $this->prefix_url = DOMAIN . 'c/' . $this->cid . '/' . $url;
     } else {
         $this->prefix_url = DOMAIN . 'c/' . $this->cid . $url;
     }
     return array('uid' => $this->userid, 'cid' => $this->cid, 'company' => $this->company, 'topmenus' => $this->topmenus);
 }
Exemplo n.º 3
0
 /**
  * 视频预览
  */
 public function video($cid, $id, $videoid)
 {
     $company = \App\Models\CompanyModel::find($cid);
     $data = GoodsModel::find($id);
     $result = ['data' => $data, 'video' => \App\Models\Base\VideoModel::find($videoid), 'uid' => $company->uid, 'videoName' => $data->name];
     return view('layout.videoPre', $result);
 }
Exemplo n.º 4
0
 public function index($cid)
 {
     $key = 'Tj1ciyqmG0quiNgpr0nmAimUCCMB5qMk';
     //自己申请的百度地图api的key
     $company = $this->company($cid, $this->list['func']['url']);
     $result = ['data' => CompanyModel::find($company['cid']), 'comMain' => $this->getComMain($company['cid']), 'topmenus' => $this->topmenus, 'prefix_url' => $this->prefix_url, 'ak' => $key];
     return view('company.contact.index', $result);
 }
Exemplo n.º 5
0
 public function index($cid, $type = 1)
 {
     $company = $this->company($cid, $this->list['func']['url']);
     $moduleid = $this->getModuleId($company['cid'], $this->genre);
     $result = ['model' => $this->model, 'company' => CompanyModel::find($company['cid']), 'comMain' => $this->getComMain($company['cid']), 'topmenus' => $this->topmenus, 'prefix_url' => $this->prefix_url, 'type' => $type];
     if (in_array($type, [1, 2])) {
         $result['data'] = $this->query($company['cid'], $moduleid, $type);
     } elseif (in_array($type, [3, 4])) {
         $result['datas'] = $this->query($company['cid'], $moduleid, $type);
     }
     return view('company.about.index', $result);
 }
Exemplo n.º 6
0
 /**
  * 地图页面
  */
 public function map()
 {
     $company = CompanyModel::find(\Session::get('user.cid'));
     $key = 'Tj1ciyqmG0quiNgpr0nmAimUCCMB5qMk';
     //自己申请的百度地图api的key
     if ($company->point) {
         $pointer = explode(',', $company->point);
         $point['lng'] = $pointer[0];
         $point['lat'] = $pointer[1];
     } else {
         $point = $this->getPoint($company->area, $company->address, $key);
     }
     $result = ['pointer' => $point, 'data' => $company, 'ak' => $key, 'curr_func' => $this->lists['func']['url']];
     return view('company.admin.contact.map', $result);
 }
Exemplo n.º 7
0
 public function query()
 {
     $data = new \stdClass();
     //type==1公司简介,2历程,3新闻,4资讯,5服务,6团队,7招聘,21单页
     $data->abouts = ComFuncModel::where('type', '<', 5)->where('cid', $this->cid)->get();
     $data->products = GoodsModel::where('genre', 1)->where('type', 4)->get();
     $data->teams = ComFuncModel::where('type', 6)->where('cid', $this->cid)->get();
     $data->jobs = ComFuncModel::where('type', 7)->where('cid', $this->cid)->get();
     //公司联系方式
     $data->contactFields = ['area', 'point', 'address', 'tel', 'qq', 'web', 'fax', 'email'];
     $data->contactFieldNames = ['地区', '坐标', '地址', '电话', 'qq', '网址', '传真', '邮箱'];
     $data->contact = 0;
     $comMainModel = CompanyModel::find($this->cid);
     $comMainModel = Tools::objectToArray($comMainModel);
     foreach ($data->contactFields as $contactField) {
         if ($comMainModel[$contactField]) {
             $data->contact++;
         }
     }
     $data->parts = GoodsModel::where('genre', 2)->where('type', 4)->get();
     $data->firms = ComFuncModel::where('type', 5)->where('cid', $this->cid)->get();
     return $data;
 }
Exemplo n.º 8
0
 public function company()
 {
     return $this->cid ? \App\Models\CompanyModel::find($this->cid) : '';
 }
Exemplo n.º 9
0
 public function company()
 {
     return $this->cid ? CompanyModel::find($this->cid)->name : '';
 }
Exemplo n.º 10
0
 /**
  * 收集数据
  */
 public function getData($data)
 {
     $serial = date('YmdHis', time()) . rand(0, 10000);
     $ip = Tools::getIp();
     $ipaddress = Tools::getCityByIp($ip);
     $companyModel = CompanyModel::find($data['cid']);
     $userModel = UserModel::find($data['uid']);
     return array('cid' => $data['cid'], 'cname' => $companyModel->name, 'visit_id' => $data['uid'], 'uname' => $userModel->username, 'action' => $data['visit_url'], 'ip' => $ip, 'ipaddress' => $ipaddress, 'serial' => $serial, 'loginTime' => time());
 }
Exemplo n.º 11
0
 /**
  * 被访问的企业名称
  */
 public function getCName()
 {
     $cid = $this->cid ? $this->cid : 0;
     $companyModel = CompanyModel::find($cid);
     return $companyModel ? $companyModel->name : '';
 }