PcDecorateThemePageEnum::TYPE_HOME])->field('id,name,create_time,update_time') ->find() ->toArray(); //todo 暂时拿当前域名 $uri = request()->domain().'/pc'; return [ 'home' => $index, 'uri' => $uri ]; } /** * @notes 获取页面 * @param int $type 页面类型 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author cjhao * @date 2021/11/30 12:00 */ public function getPage(int $type) { $page = PcDecorateThemePage::where(['type' => $type]) ->field('id,name,type,content,common') ->find() ->toArray(); return $page; } /** * @notes 设置页面 * @param array $param * @return PcDecorateThemePage * @author cjhao * @date 2021/11/30 14:44 */ public function setPage(array $param) { return PcDecorateThemePage::where(['type'=>$param['type']]) ->update($param); } /** * @notes 获取pc页面 * @param string $type * @return array * @author cjhao * @date 2021/12/6 16:57 */ public function getPcPage(string $type):array { $pageList = ShopPageEnum::PC_SHOP_PAGE; $list = []; foreach ($pageList as $page){ if($type === $page['type']){ $list[] = $page; } } return $list; } }