post(); $pageSize = request()->post('pageSize', 15); $datas = ArticleService::make()->getDataList($params, $pageSize); return message(1010, true, $datas); } /** * 详情 */ public function info() { $params = request()->all(); $id = isset($params['id'])? intval($params['id']) : 0; if(empty($id)){ return message(1036, false); } if($info = ArticleService::make()->getInfo($id)){ return message(1010, true, $info); }else{ return message(1009, false); } } /** * 客服推荐数据 */ public function customRecommend() { $keywords = ConfigService::make()->getConfigByCode('custom_keywords'); $keywords = $keywords? explode('、',$keywords) : ['问题','常见问题','账号','账号登录','登录','密码','商家','商家合作','物流','发货']; $datas = [ 'keywords'=> array_filter($keywords), 'site_custom_phone'=> ConfigService::make()->getConfigByCode('site_custom_phone'), 'category'=> [ ['id'=>9,'name'=>'常见问题','status'=>1], ['id'=>10,'name'=>'账号登录','status'=>1], ['id'=>11,'name'=>'商家合作','status'=>1], ], 'recommend'=> ArticleService::make()->getCustomRecommend(), ]; return message(1010, true, $datas); } /** * 客服咨询数据 */ public function custom() { $type = request()->post('type',0); $keyword = request()->post('keyword',''); $num = request()->post('num',6); $datas = ArticleService::make()->getCustomRecommend($type, $num, $keyword, $type==0?true:false); if($datas){ return message(1010, true, $datas); }else{ return message(1009, false); } } /** * 单页数据 */ public function page() { $params = request()->all(); $type = isset($params['type'])? intval($params['type']) : 0; if(empty($type)){ return message(1031, false); } if($info = ArticleService::make()->getInfoByType($type)){ return message(1010, true, $info); }else{ return message(1009, false); } } }