request('first_id'), 'second_id' => request('second_id') == 0 ? null : request('second_id'), 'tag_id' => request('tag_id'), 'comment_tag' => $commentTag, 'name'=>request("name","") ]; $fields = ['*']; $sort = '`rank` desc, `id` desc'; $page = request('page', 1); $limit = request('limit', 20); return SpecialistInfoFacade::getList($conditions, $fields, $sort, $page, $limit); } /** * 专家来了详情 * @param $id * @return array */ public function show($id) { $conditions = [ 'id'=>$id ]; $fields = ['*']; $result = SpecialistInfoFacade::findBy($conditions, $fields); //计数加1 SpecialistInfo::where('id', $id)->increment('number_of_studies'); $record = [ 'uid' => $this->auth(), 'column' => BrowseRecord::COLUMN_3, 'object_id' => $id, 'repeat' => 'uid:'.$this->auth().' column:'.BrowseRecord::COLUMN_3.' object_id:'.$id ]; //加入浏览记录 try { BrowseRecordFacade::create($record); } catch (\Exception $e) { } return $result; } /** * 点赞 * @param $id * @return array */ public function thumbsUpNum($id) { return SpecialistInfoFacade::thumbsUpNum($id,$this->auth()); } /** * 喜欢 * @param $id * @return array */ public function loveNum($id) { return SpecialistInfoFacade::loveNum($id,$this->auth()); } /** * 留言 * @param Request $request * @return array */ public function leaveMessage(Request $request) { $id = $request->get("id",0); $message = $request->get("message",0); return SpecialistInfoFacade::leaveMessage($id,$this->auth(),$message); } /** * 得到专家信息关联列表 * @param Request $request * @return array */ public function specialistInfosAssociationList(Request $request) { $page = request('page', 1); $limit = request('limit', 20); $associationType = request('associationType', 20); return SpecialistInfoFacade::specialistInfosAssociationList($this->auth(),$associationType,$page,$limit); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } }