当前位置: 首页 > 后端技术 > PHP

国外婚恋交友网站平台开发建设第十一篇文章

时间:2023-03-29 19:32:31 PHP

这是国外婚恋交友网站平台开发建设的第十一篇文章。清楚知道大概的功能,希望对大家的学习和使用有所帮助。有问题咨询可以加我按钮236-0248-666预览效果图礼物实现代码classGiftlistControllerextendsAdminController{publicfunction_infoModule(){$data=array('info'=>array('name'=>'虚拟礼物记录管理','description'=>'管理用户的虚拟礼物记录',),'menu'=>array(array('name'=>'礼物列表','url'=>U('Admin/Giftlist/index'),'icon'=>'list',),),);返回$数据;}publicfunctionindex(){$breadCrumb=array('系统消息列表'=>U());//面包屑分类$keyword=I('request.keyword','');//搜索关键词字段$msg_type=I('request.msg_type','','trim');//过滤字段$order_by=I('request.order_by','asc','trim');//排序$model=D('Giftlist');$pageMaps=array();$pageMaps['关键字']=$关键字;$pageMaps['touser_isread']=$touser_isread;$pageMaps['order_by']=$order_by;$哪里=数组();if(!empty($keyword)){$where['_string']='user_id='.$keyword;}if(!empty($touser_isread)){switch($touser_isread){case'0':$where['touser_isread']=0;休息;case'1':$where['touser_isread']=1;休息;}}$count=$model->countList($where);//满足条件的item总数$limit=$this->getPageLimit($count,20);//获取要的item数量每页显示$order=$order?$order:'giftlist_iddesc';//获取排序虽然规则好像不是$order$list=$model->loadList($where,$limit,$order);$ids=数组();foreach($listas$k=>$v){$ids[]=$v['fromuid'];$ids[]=$v['touid'];}$ids=array_unique($ids);//去重$ids=join($ids,',');//转化为普通数组$result=D('Giftlist')->getNicename($ids);$this->assign('niceName',$result);$this->assign('list',$list);$this->assign('page',$this->getPageShow($pageMaps));$this->assign('breadCrumb',$breadCrumb);//$this->adminDisplay();}删除数据publicfunctiondel(){$giftlist_id=I("post.data",0,"intval");if(empty($giftlist_id)){$this->error('参数不能为空');}if(D("Giftlist")->delData($giftlist_id)){$this->success("数据删除成功");}else{$this->error('数据删除失败');}}领取礼物publicfunctionbatchAction(){$ids=I('post.ids','');//接收选择的要操作的id$type=I('post.type');//接收要操作的类型如删除。.if(empty($ids)||empty($type)){$this->error('参数不能为空!');$ids=count($ids)?内爆(',',$ids):$ids[0];$result=D('Giftlist')->delMsgs($ids);if($result){$this->success('操作成功!');}else{$this->error('操作失败!');}}}