Example #1
0
 public function show($id)
 {
     $curr['name'] = $this->crumb['show']['name'];
     $curr['url'] = $this->crumb['show']['url'];
     $result = ['data' => ComFuncModel::find($id), 'modules' => ComModuleModel::all(), 'pics' => PicModel::all(), 'model' => $this->model, 'crumb' => $this->crumb, 'curr' => $curr];
     return view('admin.comfunc.show', $result);
 }
Example #2
0
 /**
  * 获取所属模块id
  */
 public function getModuleId($cid, $genre)
 {
     $moduleModel = ComModuleModel::where('cid', $cid)->where('genre', $genre)->first();
     if (!$moduleModel) {
         $moduleModel = ComModuleModel::where('cid', 0)->where('genre', $genre)->first();
     }
     return $moduleModel->id;
 }
Example #3
0
 public function create()
 {
     //判断有无该公司的扩展单页
     if (!count(ComModuleModel::where('cid', $this->cid)->get())) {
         echo "<script>alert('没有单页模,先去添加模块!');history.go(-1);</script>";
         exit;
     }
     $curr['name'] = $this->lists['create']['name'];
     $curr['url'] = $this->lists['create']['url'];
     $result = ['modules' => $this->model->singelModules($this->cid), 'model' => $this->model, 'lists' => $this->lists, 'curr' => $curr, 'curr_func' => $this->lists['func']['url']];
     return view('company.admin.single.create', $result);
 }
 public function query()
 {
     $datas = ComModuleModel::where('genre', $this->genre)->where('cid', $this->cid)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     $datas->limit = $this->limit;
     return $datas;
 }
 /**
  * 查询方法
  */
 public function query()
 {
     $datas = ComModuleModel::orderBy('id', 'desc')->paginate($this->limit);
     $datas->limit = $this->limit;
     return $datas;
 }
Example #6
0
 /**
  * 得到对应模块
  */
 public function getModule()
 {
     $module_id = $this->module_id ? $this->module_id : 0;
     $moduleModel = ComModuleModel::find($module_id);
     return $moduleModel ? $moduleModel : '';
 }
Example #7
0
 /**
  * 公司首页模块
  */
 public function modules()
 {
     return ComModuleModel::whereIn('cid', [0, $this->cid])->orderBy('sort', 'desc')->orderBy('id', 'asc')->get();
 }