public function update(Request $request, $id) { $data = $this->getData($request, $this->module); $data['updated_at'] = time(); ComFuncModel::where('id', $id)->update($data); return redirect('/company/admin/about'); }
public function query($cid) { $limit = 10; $datas = ComFuncModel::where('cid', $cid)->where('module_id', 4)->where('isshow', 1)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($limit); $datas->limit = $limit; return $datas; }
public function query($cid) { $limit = 6; $datas = ComFuncModel::where('cid', $cid)->where('module_id', 3)->where('isshow', 1)->paginate($limit); $datas->limit = $limit; return $datas; }
public function update(Request $request, $id) { $data = $this->getData($request, $this->module); $data['type'] = $this->type; $data['updated_at'] = time(); ComFuncModel::where('id', $id)->update($data); return redirect(DOMAIN . 'company/admin/team'); }
public function update(Request $request, $id) { $data = $this->getData($request, $this->module); if ($request->small) { $data['small'] = mb_substr($request->small, -1, 1, 'utf-8') == '|' ? $request->small : $request->small . '|'; } $data['type'] = $this->type; $data['updated_at'] = time(); ComFuncModel::where('id', $id)->update($data); return redirect(DOMAIN . 'company/admin/firm'); }
public function query($cid, $moduleid, $type) { if (in_array($type, [1, 2])) { $datas = ComFuncModel::where('cid', $cid)->where('module_id', $moduleid)->where('type', $type)->first(); } elseif (in_array($type, [3, 4])) { $limit = 20; $datas = ComFuncModel::where('cid', $cid)->where('module_id', $moduleid)->where('type', $type)->paginate($limit); $datas->limit = $limit; } return $datas; }
/** * 查询方法 */ public function query($module, $type) { //type==0,代表[1,2,3,4] if ($type) { $datas = ComFuncModel::where('cid', $this->cid)->where('module_id', $module)->where('type', $type)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); } else { $datas = ComFuncModel::where('cid', $this->cid)->where('module_id', $module)->whereIn('type', [1, 2, 3, 4])->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); } $datas->limit = $this->limit; return $datas; }
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; }
public function forceDelete($id) { ComFuncModel::where('id', $id)->delete(); return redirect(DOMAIN . 'admin/comfunc'); }
public function query() { $datas = ComFuncModel::where('cid', $this->cid)->where('type', '>', 20)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); $datas->limit = $this->limit; return $datas; }
/** * 企业功能查询 */ public function getFuncs($cid, $module, $limit, $type = null) { if ($type) { $datas = ComFuncModel::where('cid', $cid)->where('module_id', $module)->where('type', $type)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($limit); } else { $datas = ComFuncModel::where('cid', $cid)->where('module_id', $module)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($limit); } $datas->limit = $limit; return $datas; }