Example #1
0
 public function update(Request $request, $id)
 {
     $data = $this->getData($request, $id);
     $data['updated_at'] = time();
     ComMainModel::where('id', $id)->update($data);
     return redirect(DOMAIN . 'admin/commain');
 }
Example #2
0
 public function update(Request $request, $id)
 {
     //图片上传处理
     if ($request->hasFile('url_ori')) {
         //判断文件存在
         //验证图片大小
         foreach ($_FILES as $pic) {
             if ($pic['size'] > $this->uploadSizeLimit) {
                 echo "<script>alert(\"对不起,你上传的图片过大,请重新选择\");history.go(-1);</script>";
                 exit;
             }
         }
         $file = $request->file('url_ori');
         //获取文件
         $logo = \App\Tools::upload($file);
     }
     $data = ['logo' => isset($logo) ? $logo : '', 'title' => $request->title, 'keyword' => $request->keyword, 'description' => $request->description, 'updated_at' => date('Y-m-d H:i:s', time())];
     //同时删除原有的logo图片
     $mainModel = ComMainModel::find($id);
     if (isset($logo) && $mainModel->logo && $mainModel->logo != $this->sefLogo) {
         unlink(ltrim($mainModel->logo, '/'));
     }
     ComMainModel::where('id', $id)->update($data);
     return redirect('/company/admin/basic');
 }
Example #3
0
 public function __construct()
 {
     parent::__construct();
     $this->lists['category']['name'] = '综合应用';
     $this->lists['category']['url'] = 'general';
     $this->lists['func']['name'] = '访问管理';
     $this->lists['func']['url'] = 'visit';
     $this->model = new VisitlogModel();
     //公司页面访问日志刷新频率
     $comMainModel = ComMainModel::where('cid', $this->cid)->first();
     $this->visitRate = $comMainModel->visitRate;
 }
Example #4
0
 public function setVisit()
 {
     if (AjaxRequest::ajax()) {
         $data = Input::all();
         //公司页面访问日志刷新频率
         $comMainModel = ComMainModel::where('cid', $data['cid'])->first();
         $visitRate = $comMainModel->visitRate;
         if ($data['cid']) {
             $this->getRedis($data, $visitRate);
         }
     }
     dd('操作有误!');
 }
Example #5
0
 /**
  * 视频发布方信息
  */
 public function getUserInfo()
 {
     $companyMian = ComMainModel::where('uid', $this->uid)->first();
     return $companyMian ? $companyMian : '';
 }
Example #6
0
 public function companyMain()
 {
     $uid = $this->userid ? $this->userid : 0;
     return $uid ? ComMainModel::where('uid', $uid)->first() : '';
 }
Example #7
0
 public function getCompanyMain($uid = null)
 {
     $comMainInfo = ComMainModel::where('uid', $uid)->first();
     return $comMainInfo ? $comMainInfo : '';
 }
Example #8
0
 /**
  * 获取企业首页的功能显示列表
  */
 public function getLayoutHomeSwitchs()
 {
     $comMainModel = ComMainModel::where('cid', $this->cid)->first();
     return unserialize($comMainModel->layoutHome);
 }
Example #9
0
 /**
  * 公司基本信息
  */
 public function getComMain($cid)
 {
     return ComMainModel::where('cid', $cid)->first();
 }
Example #10
0
 /**
  * 得到访问频率
  */
 public function getVisitRate()
 {
     $comMainModel = ComMainModel::where('cid', $this->cid)->first();
     return $comMainModel ? $comMainModel->visitRate : 0;
 }
Example #11
0
 /**
  * 首页开关初始化
  */
 public function getHomeSwitch($cid)
 {
     $comMainModel = new ComMainModel();
     foreach ($comMainModel['layoutHomes'] as $k => $layoutHome) {
         $arr[$layoutHome]['key'] = $k;
         $arr[$layoutHome]['name'] = $comMainModel['layoutHomeNames'][$k];
         $arr[$layoutHome]['value'] = 1;
     }
     ComMainModel::where('cid', $cid)->update(['layoutHome' => serialize($arr)]);
 }
Example #12
0
 public function getLogo()
 {
     $comMainModel = ComMainModel::where('cid', $this->id)->first();
     return $comMainModel->logo;
 }