/** * 获取链接数据列表 */ public function links() { if ($links = LinkModel::all()) { return Tools::getChild($links, $pid = 0); } return []; }
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); }
public static function getFooters() { return Tools::getChild(LinkModel::footers(), $pid = 0); }
/** * ========================== * 一下是公用方法 * ========================== */ public function query() { $datas = LinkModel::paginate($this->limit); $datas->limit = $this->limit; return $datas; }
public static function getHeaders() { return Tools::getChild(LinkModel::headers(), $pid = 0); }
/** * 脚步链接 */ public function footlinks($cid, $limit) { $datas = LinkModel::where('cid', $cid)->where('type_id', 3)->where('isshow', 1)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($limit); $datas->limit = $limit; return $datas; }
public static function getNavigates() { return Tools::getChild(LinkModel::navigates(), $pid = 0); }
public function query() { $datas = LinkModel::where('cid', $this->cid)->where('type_id', 2)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); $datas->limit = $this->limit; return $datas; }