123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619 |
- <?php
- /**
- * 公用API
- */
- class CommonController extends ApiBaseController {
- public function beforeAction($action){
- $weixin_use = array('staticsource','getsubcity', 'getallcity');
- if(in_array(strtolower($action->id),$weixin_use)){
- return true;
- }
- return $this->verify();
- }
- public function actionDiscover(){
- $page = intval(Yii::app()->getRequest()->getParam("page",1));
- $page = $page?$page:1;
- $type = Yii::app()->request->getParam('type','');
- $user_id = Yii::app()->request->getParam('user_id','');
- $device_id = Yii::app()->request->getParam('device_id','');
- if($type == 'digest'){
- $city_info = json_decode(Yii::app()->request->getParam('city_info'),true);
- //防止city_info出现非法数据
- if(!isset($city_info['province'])){
- $city_info['province'] = '';
- $city_info['city'] = '';
- $city_info['area'] = '';
- }elseif(!isset($city_info['city'])){
- $city_info['city'] = '';
- $city_info['area'] = '';
- }elseif(!isset($city_info['area'])){
- $city_info['area'] = '';
- }
- $z_User = new ZUser();
- $user = $z_User->idExist($user_id);
- $z_group = new ZGroup();
- $res_topics = array();
- $actiontime = CommonFn::getFirstTime(ActionTimeRedis::TYPE_GET_INDEX,$device_id,$page);
- $_user = null;
- if($user){
- $_user = $user['_id'];
- }
- $picked_groups = $z_group->get_user_picked_groups($_user,$city_info,false,true);
- $picked_groups = $z_group->filter_special($picked_groups);
- $parsed_groups = array();
- foreach($picked_groups as $picked_group){
- $parsed_groups[] = new MongoId($picked_group['_id']);
- }
- $pagesize = Yii::app()->params['indexPageSize'];
- $conditions = array(
- 'group'=>array('in',$parsed_groups),
- 'status'=>array('==',1),
- 'time'=>array('<=',$actiontime)
- );
- $order = array(
- 'time'=>'desc',
- );
- $model = new Topic();
- $pagedata = CommonFn::getPagedata($model,$page,$pagesize,$conditions,$order,false,false);
- $topics = $pagedata['res'];
- foreach($topics as $topic){
- $_topic = $model->parseRow($topic,array('id','content','city_info','time','time_str','group','visit_count','reply_count','fav_count','like_count','user','pics','voice','video','last_post_time','last_post_time_str'));
- if($user){
- $z_like = new ZLike();
- $like = $z_like->getLikeByLikeObj((string)$user['_id'],$_topic['id']);
- if(empty($like)){
- $_topic['is_liked'] = false;
- }else{
- $_topic['is_liked'] = true;
- }
- }else{
- $_topic['is_liked'] = false;
- }
- $res_topics[] = $_topic;
- }
- CommonFn::requestAjax(true,'',$res_topics,200,array('sum_count' => $pagedata['sum_count'],'sum_page'=>$pagedata['sum_page'],'page_size'=>$pagedata['page_size'],'current_page'=>$pagedata['current_page']));
- }else{
-
- }
- }
- //推荐帖子
- public function actionIndex(){
- $page = intval(Yii::app()->getRequest()->getParam("page",1));
- $city_info = json_decode(Yii::app()->request->getParam('city_info'),true);
- if(empty($page)){
- $page = 1;
- }
- $user_id = Yii::app()->request->getParam('user_id','');
- $device_id = Yii::app()->request->getParam('device_id','');
- //防止city_info出现非法数据
- if(!isset($city_info['province'])){
- $city_info['province'] = '';
- $city_info['city'] = '';
- $city_info['area'] = '';
- }elseif(!isset($city_info['city'])){
- $city_info['city'] = '';
- $city_info['area'] = '';
- }elseif(!isset($city_info['area'])){
- $city_info['area'] = '';
- }
- $z_User = new ZUser();
- $user = $z_User->idExist($user_id);
- $z_group = new ZGroup();
- $z_topic = new ZTopic();
- $arr = array();
- $actiontime = CommonFn::getFirstTime(ActionTimeRedis::TYPE_GET_INDEX,$device_id,$page);
- $_user = null;
- if($user){
- $_user = $user['_id'];
- }
- $picked_groups = $z_group->get_user_picked_groups($_user,$city_info,false,true);
- $picked_groups = $z_group->filter_special($picked_groups);
- $parsed_groups = array();
- foreach($picked_groups as $picked_group){
- $parsed_groups[] = new MongoId($picked_group['_id']);
- }
- $pagesize = Yii::app()->params['indexPageSize'];
- $conditions = array(
- 'group'=>array('in',$parsed_groups),
- 'status'=>array('==',1),
- 'time'=>array('<=',$actiontime)
- );
- $order = array(
- 'time'=>'desc',
- );
- $model = new Topic();
- $pagedata = CommonFn::getPagedata($model,$page,$pagesize,$conditions,$order,false,false);
- $topics = $pagedata['res'];
- $front_topic_user = '';
- $last_topics = array();
- foreach($topics as $topic){
- $_topic = $model->parseRow($topic,array('id','content','city_info','time','time_str','group','visit_count','reply_count','fav_count','like_count','user','pics','voice','video','last_post_time','last_post_time_str'));
- if($user){
- $z_like = new ZLike();
- $like = $z_like->getLikeByLikeObj((string)$user['_id'],$_topic['id']);
- if(empty($like)){
- $_topic['is_liked'] = false;
- }else{
- $_topic['is_liked'] = true;
- }
- }else{
- $_topic['is_liked'] = false;
- }
- if($_topic['user']['id'] == $front_topic_user){
- $last_topics[] = array('type'=>'topic','item'=>$_topic);
- }else{
- $front_topic_user = $_topic['user']['id'];
- $arr[] = array('type'=>'topic','item'=>$_topic);
- }
- }
- $arr = array_merge($arr,$last_topics);
- CommonFn::requestAjax(true,'',$arr,200,array('sum_count' => $pagedata['sum_count'],'sum_page'=>$pagedata['sum_page'],'page_size'=>$pagedata['page_size'],'current_page'=>$pagedata['current_page']));
- }
- //首页轮播的图
- public function actionSlide(){
- $city_info = json_decode(Yii::app()->request->getParam('city_info'),true);
- $city_info_pro = isset($city_info['province'])?$city_info['province']:'';
- $criteria = new EMongoCriteria();
- $criteria->status('==', 1);
- if(CommonFn::compareVersion('2.7.2',Yii::app()->request->getParam('app_version',''))){
- $criteria->type('!=','subject');
- }
- $criteria->sort('order', EMongoCriteria::SORT_DESC);
- $cursor = Slide::model()->findAll($criteria);
- $rows = CommonFn::getRows($cursor);
- foreach ($rows as $key => $value) {
- if(isset($value['city_info'])&&isset($value['city_info']['province'])&&$value['city_info']['province']!=$city_info_pro&&$value['city_info']['province']!=''){
- unset($rows[$key]);
- }elseif(isset($value['end_time'])&&$value['end_time']<=time()&&$value['end_time']!==0&&!empty($value['end_time'])){
- unset($rows[$key]);
- }
- }
- $parsedRows = Slide::model()->parse($rows);
- $parsedRows = array_values($parsedRows);
- CommonFn::requestAjax(true,'',$parsedRows);
- }
- //积分规则
- public function actionScoreRule(){
- $score_rule = Yii::app()->params['score_rule'];
- $data = array();
- foreach ($score_rule as $value) {
- $data[] = $value;
- }
- CommonFn::requestAjax(true,'',$data);
- }
- //发帖选择圈子接口
- public function actionTopicGroupList(){
- $user_id = Yii::app()->request->getParam('user_id');
- if(!CommonFn::isMongoId($user_id)){
- CommonFn::requestAjax(false,CommonFn::getMessage('message','params_illegal'));
- }
- $user = RUser::get(new MongoId($user_id));
- if(!$user){
- CommonFn::requestAjax(false,CommonFn::getMessage('message','params_illegal'));
- }
- $follow_groups = $user->groups;
- $criteria = new EMongoCriteria();
- $criteria->can_topic('==',1);
- $criteria->status('==',1);
- $criteria->sort('order', EMongoCriteria::SORT_DESC);
- $cursor = Group::model()->findAll($criteria);
- $first_section = array();
- $second_section = array();
- foreach ($cursor as $key => $value) {
- if(in_array((string)$value->_id,$follow_groups)){
- $first_section[] = array('id'=>(string)$value->_id,'name'=>(string)$value->name,'avatar'=>$value->avatar);
- }elseif(!isset($value->city_info['city']) || empty($value->city_info['city']) || (isset($user->city_info['city']) && $value->city_info['city'] == $user->city_info['city'])){
- $second_section[] = array('id'=>(string)$value->_id,'name'=>(string)$value->name,'avatar'=>$value->avatar);
- }
- }
- $group_list = array_merge($first_section,$second_section);
- CommonFn::requestAjax(true,'success',array('group_list'=>$group_list));
- }
- //客户端手动更新
- public function actionUpdateApp(){
- $version = Yii::app()->request->getParam('app_version');
- $app_client_id = Yii::app()->request->getParam('app_client_id');
- $channel = Yii::app()->request->getParam('channel','');
- $network_type = Yii::app()->request->getParam('network_type','');
- if(empty($version)||empty($app_client_id)){
- CommonFn::requestAjax(false,CommonFn::getMessage('message','request_illegal'));
- }
- if($app_client_id == 2){
- $leatest_version = Service::factory('VariableService')->getVariable('android_new_version');
- }elseif($app_client_id == 1){
- $leatest_version = Service::factory('VariableService')->getVariable('ios_new_version');
- }else{
- CommonFn::requestAjax(false,CommonFn::getMessage('message','request_illegal'));
- }
- if($network_type == 'wifi' && CommonFn::compareVersion($leatest_version,Yii::app()->request->getParam('app_version',''))){
- if($app_client_id == 2){
- $channel_apk = Yii::app()->params['channel_apk'];
- if(isset($channel_apk[$channel])){
- $download_url = $channel_apk[$channel];
- }else{
- $download_url = $channel_apk['guanwang'];
- }
- $info = array('new_version'=>$leatest_version,'size' => '34M','download'=>$download_url,'message'=>'新爪爪出来咯,快来找我玩≧△≦');
- }else{
- $info = array('new_version'=>$leatest_version,'message'=>'新爪爪出来咯,快来找我玩≧△≦');
- }
- CommonFn::requestAjax(true,CommonFn::getMessage('message', 'have_newer'),$info);
- }else{
- CommonFn::requestAjax(false,'');
- }
- }
- //获取全部的城市信息
- public function actionGetAllCity(){
- $criteria = new EMongoCriteria();
- $criteria->sort('parent_province_id', EMongoCriteria::SORT_ASC);
- $criteria->sort('parent_city_id', EMongoCriteria::SORT_ASC);
- $cursor = CityLib::model()->findAll($criteria);
- $res = CommonFn::getRowsFromCursor($cursor);
- $province = array();
- $city = array();
- $area = array();
- $keyMap = array();
- foreach ($res as $item) {
- $keyMap[$item['_id']] = $item['name'];
- }
- foreach ($res as $item) {
- $parent = $item['parent_area_id'];
- $level = 4;
- if ($parent == 0) {
- $parent = $item['parent_city_id'];
- $level = 3;
- }
- if ($parent == 0) {
- $parent = $item['parent_province_id'];
- $level = 2;
- }
- if ($parent == 0) {
- $level = 1;
- }
- if ($level == 1) {
- $province[] = $item['name'];
- } else if ($level == 2) {
- $city[$keyMap[$item['parent_province_id']]][] = $item['name'];
- } else if ($level == 3) {
- $area[$keyMap[$item['parent_city_id']]][] = $item['name'];
- }
- }
- $data = array('p' => $province, 'c' => $city, 'a' => $area);
- CommonFn::requestAjax(true, CommonFn::getMessage('message', 'operation_success'), $data, 200);
- }
- //获取城市级联信息
- public function actionGetSubCity(){
- $address_info = json_decode(Yii::app()->request->getParam('address_info'),true);
- if(!isset($address_info['province']) || $address_info['province'] == '未知'){
- $address_info = array();
- }
- $province = array();
- $city = array();
- $area = array();
- $z_citylib = new ZCityLib();
- if(isset($address_info['province'])&&$address_info['province']){
- $province = $z_citylib->getSubCity(1);
- foreach ($province as $key => $value) {
- if($value['name'] == $address_info['province']){
- $province[$key]['is_selected'] = 1;
- $city = $z_citylib->getSubCity($value['city_code']);
- foreach ($city as $sub_key => $sub_value) {
- if(isset($address_info['city']) && $sub_value['name'] == $address_info['city']){
- $have_selected = true;
- $city[$sub_key]['is_selected'] = 1;
- $area = $z_citylib->getSubCity($sub_value['city_code']);
- foreach ($area as $grand_key => $grand_value) {
- if($grand_value['name'] == $address_info['area']){
- $area[$grand_key]['is_selected'] = 1;
- }else{
- $area[$grand_key]['is_selected'] = 0;
- }
- }
- }else{
- $city[$sub_key]['is_selected'] = 0;
- }
- }
- if(!isset($have_selected)){
- $city[0]['is_selected'] = 1;
- $area = $z_citylib->getSubCity($city[0]['city_code']);
- foreach ($area as $grand_key => $grand_value) {
- if($grand_key == 0){
- $area[$grand_key]['is_selected'] = 1;
- }else{
- $area[$grand_key]['is_selected'] = 0;
- }
- }
- }
- }else{
- $province[$key]['is_selected'] = 0;
- }
- }
- }else{
- $province = $z_citylib->getSubCity(1);
- foreach ($province as $key => $value) {
- if($value['name'] == '上海市'){
- $province[$key]['is_selected'] = 1;
- }else{
- $province[$key]['is_selected'] = 0;
- }
- }
- foreach ($province as $key => $value) {
- if($value['name'] == '上海市'){
- $city = $z_citylib->getSubCity($value['city_code']);
- foreach ($city as $sub_key => $sub_value) {
- if($sub_value['name'] == '上海市'){
- $city[$sub_key]['is_selected'] = 1;
- }else{
- $city[$sub_key]['is_selected'] = 0;
- }
- }
- $area = $z_citylib->getSubCity($city[0]['city_code']);
- foreach ($area as $sub_key => $sub_value) {
- if($sub_value['name'] == '上海市'){
- $area[$sub_key]['is_selected'] = 1;
- }else{
- $area[$sub_key]['is_selected'] = 0;
- }
- }
- }
- }
- }
- //容错处理,防止客户端上传错误城市
- if(empty($province)){
- $province = $z_citylib->getSubCity(1);
- foreach ($province as $key => $value) {
- if($value['name'] == '上海市'){
- $province[$key]['is_selected'] = 1;
- }else{
- $province[$key]['is_selected'] = 0;
- }
- }
- }
- if(empty($city)){
- foreach ($province as $key => $value) {
- if($value['is_selected'] == 1){
- $temp_code = $value['city_code'];
- }
- }
- $city = $z_citylib->getSubCity($temp_code);
- if(empty($city)){
- $temp['name'] = '';
- $city[] = $temp;
- }
- $city[0]['is_selected'] = 1;
- }
- if(empty($area)){
- foreach ($city as $key => $value) {
- if($value['is_selected'] == 1){
- $temp_code = $value['city_code'];
- }
- }
- $area = $z_citylib->getSubCity($temp_code);
- if(empty($area)){
- $temp['name'] = '';
- $area[] = $temp;
- }
- $area[0]['is_selected'] = 1;
- }
- foreach ($province as $key => $value) {
- unset($province[$key]['city_code']);
- }
- foreach ($city as $key => $value) {
- unset($city[$key]['city_code']);
- }
- foreach ($area as $key => $value) {
- unset($area[$key]['city_code']);
- }
- $data['provinces'] = $province;
- $data['citys'] = $city;
- $data['areas'] = $area;
- CommonFn::requestAjax(true,CommonFn::getMessage('message','operation_success'),$data,200);
- }
- public function actionPay(){
- $pay_channel = Yii::app()->getRequest()->getParam("pay_channel");
- $order_id = Yii::app()->getRequest()->getParam("order_id");
- $callback = Yii::app()->getRequest()->getParam("callback");
- $amount = 1;
- $result = Service::factory('PayService')->Pay($pay_channel,$amount);
- if($callback){
- echo $callback."($result)";
- die();
- }
- echo $result;
- }
- public function actionRetrieve(){
- $charge_id = Yii::app()->getRequest()->getParam("charge_id");
- $result = Service::factory('PayService')->retrieve($charge_id);
- echo $result;
- }
- public function actionInit(){
- $cache = new ARedisCache();
- $key = 'data_cache_common_init';
- $data_cache = $cache->get($key);
- $data = array();
- if($data_cache){
- $data = unserialize($data_cache);
- }else{
- $host = ENVIRONMENT=='product'?'www.yiguanjia.me':'wwwtest.yiguanjia.me';
- $hot_keys = trim(Service::factory('VariableService')->getVariable('hot_keywords'));
- $hot_keys = explode("\n",$hot_keys);
- $criteria = new EMongoCriteria();
- $criteria->time('<=',time());
- $criteria->limit(1);
- $criteria->sort('time',EMongoCriteria::SORT_DESC);
- $r_card = RecommendCard::model()->findAll($criteria);
- $new_card_time = 0;
- foreach ($r_card as $key => $value) {
- $new_card_time = $value->time;
- break;
- }
- $subject = new Subject();
- $criteria = new EMongoCriteria();
- $criteria->is_recommend('==', 1);
- $criteria->sort('rank',EMongoCriteria::SORT_DESC);
- $criteria->status('==', 1);
- $criteria->limit(8);
- $res = $subject->findAll($criteria);
- $data['recommend_subject'] = array_values($subject->parse($res));
- $data['limit_conf'] = Yii::app()->params['limit_conf'];
- $data['new_user_coupons_value'] = Yii::app()->params['new_user_coupons_value']?Yii::app()->params['new_user_coupons_value']:0;
- $data['app_video_conf'] = Yii::app()->params['app_video_conf'];
- $data['new_card_time'] = $new_card_time;
- $data['hot_keywords'] = $hot_keys;
- $data['report_reason'] = Yii::app()->params['report_reason'];
- $data['certify_url'] = isset(Yii::app()->params['certify_url'])?Yii::app()->params['certify_url']:'';
- $data['tool_box_url'] = 'http://www.wozhua.mobi/webapp/pet';
- $data['deal_url'] = 'http://'.$host.'/o2o/web/index/deal?need_header=0';
- $pic_edit = Service::factory('VariableService')->getVariable('pic_edit');
- $data['pic_edit'] = intval($pic_edit);
- $data['topic_report_reason'] = Yii::app()->params['topic_report_reason'];
- $data['user_report_reason'] = Yii::app()->params['user_report_reason'];
- $data['kefu_user'] = Yii::app()->params['kefu_user'];
- $data['enable_clear_cache'] = 0;
- $updata_message = array('title'=>'有新版本发布了','content' => CommonFn::getMessage('message','have_newer'));
- $data['updata_message'] = $updata_message;
- $cache->set($key,serialize($data),300);
- }
- $close_versions = explode(',',Service::factory('VariableService')->getVariable('close_versions'));
- if( in_array(Yii::app()->request->getParam('app_version',''),$close_versions)){
- $data['foreign_link_open'] = 0;
- $data['lottery_open'] = 0;
- }else{
- $data['lottery_open'] = 1;
- $data['foreign_link_open'] = 1;
- }
- $data['enable_clear_cache'] = 1;
- $data['certify_type'] = Yii::app()->params['new_certify_type'];
- //最新版本
- $app_client_id = Yii::app()->request->getParam('app_client_id');
- $leatest_version = '';
- if($app_client_id == 2){
- $leatest_version = Service::factory('VariableService')->getVariable('android_new_version');
- }elseif($app_client_id == 1){
- $leatest_version = Service::factory('VariableService')->getVariable('ios_new_version');
- }
- $data['new_app_version'] = $leatest_version;
- CommonFn::requestAjax(true,'',$data);
- }
- public function actionGetUrl(){
- $url_id = Yii::app()->getRequest()->getParam("url_id");
- $data['url'] = Service::factory('VariableService')->getVariable($url_id);
- $success = empty($data) ? false : true;
- $message = $success ? '' : 'URL不存在';
- CommonFn::requestAjax($success, $message, $data);
- }
- public function actionReport() {
- $user = Yii::app()->request->getParam('user_id', '');
- $reason = Yii::app()->request->getParam('reason', '');
- $time = time();
- $to_user_id = Yii::app()->request->getParam('to_user_id', '');
- $topic_id = Yii::app()->request->getParam('topic_id', '');
- if ((empty($to_user_id) && empty($topic_id)) // 举报对象
- || empty($user) || empty($reason)) { // 举报用户和理由
- CommonFn::requestAjax(false, '参数不全', array());
- }
- $type = empty($to_user_id) ? 'topic' : 'user';
- $object = empty($to_user_id) ? $topic_id : $to_user_id;
- $object_id = new MongoId($object);
- $user_id = new MongoId($user);
- $reports = Report::getByUser($user_id, $object_id);
- if ($reports != false) {
- $reports->next();
- $report = $reports->current();
- if ($report->status == 0) {
- CommonFn::requestAjax(false, '已经举报过了哦', array());
- }
- }
- $report = new Report();
- $report->type = $type;
- $report->object = $object_id;
- $report->user = $user_id;
- $report->reason = $reason;
- $report->time = $time;
- $success = $report->insert();
- $message = $success ? '举报成功' : '举报失败';
- CommonFn::requestAjax($success, $message, array());
- }
- public function actionCustomeParam() {
- $user_id = Yii::app()->request->getParam('user_id', '');
- $device_id = Yii::app()->request->getParam('device_id');
- $data['new_user_coupons_value'] = Yii::app()->params['new_user_coupons_value']?Yii::app()->params['new_user_coupons_value']:0;
- if($user_id){
- $cache = new ARedisCache();
- $key = 'new_user_coupons_check'.$user_id;
- $new_user_coupons_check = $cache->get($key);
- if(!$new_user_coupons_check){
- if(CommonFn::isMongoId($user_id)){
- $user_id = new MongoId($user_id);
- $criteria = new EMongoCriteria();
- $criteria->user('==',$user_id);
- $coupons = UserCoupon::model()->count($criteria);
- if($coupons<1){
- $data['get_user_coupons'] = 1;
- }else{
- $data['get_user_coupons'] = 0;
- }
- }else{
- $data['get_user_coupons'] = 0;
- }
- }else{
- $data['get_user_coupons'] = 0;
- }
- }elseif ($device_id) {
- $cache = new ARedisCache();
- $key = 'new_user_coupons_check'.$device_id;
- $new_user_coupons_check = $cache->get($key);
- if(!$new_user_coupons_check){
- $criteria = new EMongoCriteria();
- $criteria->user_device_id('==',$device_id);
- $coupons = UserCoupon::model()->count($criteria);
- if($coupons<1){
- $data['get_user_coupons'] = 1;
- }else{
- $data['get_user_coupons'] = 0;
- }
- }
- }else{
- $data['get_user_coupons'] = 0;
- }
- CommonFn::requestAjax(true,'success', $data);
- }
- public function actionStaticSource() {
- $key = Yii::app()->request->getParam('key');
- $static = StaticSource::getByKey($key);
- if (!$static) {
- CommonFn::requestAjax(false, '资源不存在', []);
- } else {
- CommonFn::requestAjax(true, '', [
- 'id' => (string)$static->_id,
- 'key' => $static->key,
- 'title' => $static->title? $static->title : '',
- 'content' => $static->content,
- ]);
- }
- }
- }
|