get('app_list_id'); if (empty($app_list_id)) { return reValue(4002, null, ['app_list 不存在']); } $xhz_name=PushMessage::getxhz_name($app_list_id); if ($xhz_name->name=="小花猪") { $xhz_lists=PushMessage::getxhz_lists($app_list_id); if (empty($xhz_lists)) { $xhz_lists=[]; } foreach ($xhz_lists as $key => $val) { $val->push_time=date('Y-m-d H:i',$val->push_time); } return reValue(0, $xhz_lists); }else{ return reValue(4002, null, ['app_name 不存在']); } } /** * [getMessage app消息列表] * @Author liujuan * @DateTime 2018-12-28 16:00 * @param Request $request [description] * @return [type] [description] */ public function getMessage(Request $request) { $app_name = $request->get('app_name'); if (empty($app_name)) { return reValue(4002, null, ['app_name 不存在']); } // 根据包名获取所有app_list_id $app_list_id=PushMessage::get_app_lists($app_name); // print_r($app_list_id);die; if (empty($app_list_id)) { $info=[]; } $arr=[]; if ($app_list_id) { foreach ($app_list_id as $key => $val) { $arr[]=$val->app_list_id; } $num=count($arr); // print_r($num);die; if ($num>1) { $info=PushMessage::get_app_info($arr); }else{ $info=PushMessage::getxhz_lists(array_values($arr)); } //根据app_list_id获取所有推送消息 if ($info) { foreach ($info as $k1 => $v1) { $v1->push_time=date('Y-m-d H:i',$v1->push_time); } } if (empty($info)) { $info=[]; } } return reValue(0, $info); } }