• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

国外婚恋找对象网站平台开发搭建-第十一篇

php 搞代码 3年前 (2022-02-28) 19次浏览 已收录 0个评论


这个是国外婚恋找对象网站平台开发搭建 第十一篇,也是后盾篇,还是跟之前的一样,先截图上先,这样能够让大家更清晰的晓得大略实现的性能,心愿能够帮到大家的学习和应用。
如果有什么问题须要征询的,能够加我的扣236-0248-666

预览效果图

 

 礼物实现代码

class GiftlistController extends AdminController{

      
  public function _infoModule(){
     $data = array(
        'info' => array(
            'name' => '虚构礼物记录治理',
            'description' => '治理用户的虚构礼物赠送记录',
        ),
        'menu' => array(
            array(
                'name' => '赠送列表',
                'url' => U('Admin/Giftlist/index'),
                'icon' => 'list',
            ),        
        ),
    );
    return $data;         
  }

public function index(){

        $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['keyword'] = $keyword;
        $pageMaps['touser_isread'] = $touser_isread;
        $pageMaps['order_by'] = $order_by;
        $where = array();
        if(!empty($keyword)){
            $where['_string'] = 'user_id='.$keyword;
        }
        
        if(!empty($touser_isread)){
            switch($touser_isread){
                case '0':
                    $where['touser_isread'] = 0;
                    break;
                case '1':
                    $where['touser_isread'] = 1;
                    break;
            }
        }
        
        $count = $model -> countList($where);//满足条件的总条数
        $limit = $this -> getPageLimit($count,20);//获取每页要显示的条数
        $order = $order? $order: 'giftlist_id desc'; //获取排序规定  尽管如同并没有$order
                    
        $list = $model -> loadList($where,$limit,$order);
              
                    
                    $ids = array();    
    foreach($list as $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();
    }


删除数据

public function del(){

        $giftlist_id = I("post.data",0,"intval");
        if(empty($giftlist_id)){
            $this -> error('参数不能为空');
        }
        
        if( D("Giftlist") -> delData($giftlist_id) ){
            $this -> success("数据删除胜利");
        }else{
            $this -> error('数据删除失败');
        }
    }

接管礼物

public function batchAction(){

        $ids  = I('post.ids',''); //接管所选中的要操作id
        $type = I('post.type');//接管要操作的类型   如删除。。。
        if(empty($ids)||empty($type)){
            $this->error('参数不能为空!');
        }
        $ids = count($ids) ? implode(',', $ids) : $ids[0];
        $result = D('Giftlist') -> delMsgs($ids);
        if($result){
            $this -> success('操作胜利!');
        }else{
            $this -> error('操作失败!');
        }
    }

}


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:国外婚恋找对象网站平台开发搭建-第十一篇

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址