コード例 #1
0
ファイル: IndexController.class.php プロジェクト: gzwyufei/hp
 /**
  * 类别列表
  */
 public function category()
 {
     $cateid = I('get.cid');
     if (empty($cateid)) {
         $this->_empty();
     }
     $where['cateid'] = $cateid;
     $where['status'] = true;
     $count = M('Works')->where($where)->count();
     $page = $this->Pages($count, 10);
     $pageurl = '?page=' . urlencode('[PAGE]');
     $page->url = __APP__ . '/category/' . $cateid . '/' . $pageurl;
     $this->pagecount = $page->totalRows / $page->listRows;
     $list = D('Home/Works')->relation(array('User', 'Category'))->where($where)->order('iftj DESC,workid DESC')->limit($page->firstRow . ',' . $page->listRows)->select();
     $this->assign('catename', $list[0]['catename']);
     $this->assign('list', $list);
     $this->assign("Page", $page->show());
     $this->assign('midad', parent::getAdvert(3, 1, 0, 1));
     //右上角广告
     $this->assign('righttopad', parent::getAdvert(3, 3, 0, 1));
     //热门活动
     $this->assign('activitytj', D('Home/Activity')->activitytj(2));
     //焙友动态
     $this->userDynamicData = D('Home/User')->userDynamic(5);
     //分享达人
     $this->assign('sharedaren', D('Home/User')->sharedaren(5, $this->userid));
     $this->display();
 }
コード例 #2
0
 protected function _initialize()
 {
     parent::_initialize();
     if (!C('WEB_SITE_CLOSE')) {
         $this->error('站点已经关闭,请稍后访问~');
     }
 }
コード例 #3
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->openuid = I('get.openuid');
     if (getUidByOpenuid($this->openuid)) {
         $this->uid = getUidByOpenuid($this->openuid);
     } else {
         $this->error('您无权访问当前页面!');
     }
     $this->assign('openuid', $this->openuid);
     //会员信息
     $this->memberDetail = D('Home/User')->find($this->uid);
     //烘焙作品数
     $this->hbworksnum = getCount('Works', array('userid' => $this->uid, 'type' => 1));
     //随拍作品
     $this->spworksnum = getCount('Copy', array('userid' => $this->uid));
     //关注数
     $this->attentionnum = getCount('UserFans', array('myid' => $this->uid));
     //被关注数
     $this->fansnum = getCount('UserFans', array('userid' => $this->uid));
     //是否关注
     $this->isfans = getCount('UserFans', array('myid' => $this->userid, 'userid' => $this->uid, 'status' => true));
     //中间广告
     $this->midad = parent::getAdvert(9, 1, 0, 1);
 }
コード例 #4
0
 protected function _initialize()
 {
     parent::_initialize();
     $config = cache('Config');
     $this->appid = $config['wxappid'];
     $this->appsecret = $config['wxappsecret'];
     $this->get_user_openid();
 }
コード例 #5
0
ファイル: JifenController.class.php プロジェクト: gzwyufei/hp
 protected function _initialize()
 {
     parent::_initialize();
     //中间图片
     $this->midad = $this->getAdvert(5, 1, 0, 1);
     //右侧广告
     $this->rightad = parent::getAdvert(5, 3, 0, 1);
 }
コード例 #6
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->id = I('get.id', 0, 'intval');
     $this->catid = I('get.catid', 0, 'intval');
     $this->userid = service("Passport")->userid ?: 0;
     $this->groupid = service("Passport")->groupid;
 }
コード例 #7
0
 protected function _initialize()
 {
     parent::_initialize();
     //会员参数设置
     $this->userConfig = array('qq_akey' => '', 'qq_skey' => '', 'defaultupoint' => 50, 'enablemailcheck' => true);
     $this->userDb = D('User/User');
     //登陆检测
     $this->check_user();
 }
コード例 #8
0
 protected function _initialize()
 {
     parent::_initialize();
     $uid = isset($_REQUEST['uid']) && ($_REQUEST['uid'] = intval($_REQUEST['uid'])) > 0 ? $_REQUEST['uid'] : is_login();
     if (!$uid) {
         $this->error('需要登录');
     }
     $this->assign('uid', $uid);
     $this->mid = is_login();
 }
コード例 #9
0
ファイル: TryController.class.php プロジェクト: gzwyufei/hp
 public function index()
 {
     //推荐产品
     $filed = array('tryid', 'title', 'image', 'requestnum', 'price', 'trynum', 'end_time');
     $this->tjtry = M('TryItems')->field($filed)->where(array('status' => true, 'iftj' => true, 'iffinish' => false))->order('sort DESC,tryid DESC')->limit(1)->find();
     $this->hottry = M('TryItems')->field($filed)->where(array('status' => true, 'ifhot' => true, 'iffinish' => false))->limit(10)->select();
     $this->newesttry = M('TryItems')->field($filed)->where(array('status' => true, 'iftj' => true, 'iffinish' => false))->order('sort DESC,tryid DESC')->limit(0, 6)->select();
     $this->tryreport = M('TryReport')->field('tryid,image,id')->where(array('status' => true))->limit(6)->select();
     //中间广告位
     $this->assign('midad', parent::getAdvert(6, 1, 0, 1));
     $this->display();
 }
コード例 #10
0
 public function index()
 {
     $get = I('get.');
     $type = I('get.t');
     $keyword = \Input::getVar(I('get.keyword'));
     if (empty($type)) {
         $this->_empty();
     }
     if (empty($keyword)) {
         $this->error('亲爱的,你似乎没有输入需要搜索的关键词...');
     }
     $url = '&keyword=' . $keyword . '&t=' . $type;
     if ($type == 1) {
         //中间广告位
         $this->assign('midad', parent::getAdvert(2, 1, 0, 1));
         $worksModel = M('Works');
         $where['status'] = array('EQ', true);
         $where['title'] = array("LIKE", "%{$keyword}%");
         $count = $worksModel->where($where)->count();
         $page = $this->Pages($count, 30);
         $pageurl = '?page=' . urlencode('[PAGE]');
         $page->url = __APP__ . '/search/' . $pageurl . $url;
         $Model = new Model();
         $list = $Model->table(array(C('DB_PREFIX') . 'works' => 'W', C('DB_PREFIX') . 'user' => 'U'))->where("W.userid=U.userid and W.status=true and W.title like '%" . $keyword . "%'")->field('W.title,W.type,W.content,W.goodnum,W.msgnum,W.workid,W.create_time,W.image,U.nickname,U.uavatar,U.openuid,U.uprovince,U.ucity,U.userid,U.ifrz')->order('msgnum DESC')->limit($page->firstRow . ',' . $page->listRows)->select();
         foreach ($list as $key => $value) {
             $list[$key]['dignum'] = M('Dig')->where(array('status' => true, 'infoid' => $value['workid'], 'userid' => $this->userid))->count();
         }
         $this->assign('keywords', $keyword);
         $this->assign("list", $list);
         $this->assign("Page", $page->show());
         $this->display('works');
     } else {
         $userModel = M('User');
         $where['status'] = array('EQ', true);
         $where['nickname'] = array("LIKE", "%{$keyword}%");
         $count = $userModel->where($where)->count();
         $page = $this->Pages($count, 40);
         $pageurl = '?page=' . urlencode('[PAGE]');
         $page->url = __APP__ . '/search/' . $pageurl . $url;
         $list = $userModel->where($where)->field('userid,uavatar,openuid,nickname,worksnum,spnum,fansnum')->order('worksnum DESC')->limit($page->firstRow . ',' . $page->listRows)->select();
         foreach ($list as $key => $value) {
             $list[$key]['worknums'] = $value['worksnum'] + $value['spnum'];
             if (M('UserFans')->where(array('userid' => $value['userid'], 'myid' => $this->userid, 'status' => true))->count() > 0) {
                 $list[$key]['isfans'] = true;
             }
         }
         $this->assign("list", $list);
         $this->assign("Page", $page->show());
         $this->display('user');
     }
 }
コード例 #11
0
 protected function _initialize()
 {
     //检查是否后台登录,后台登录下优先级最高,用于权限判断
     if (\Admin\Service\User::getInstance()->id) {
         define('IN_ADMIN', true);
         $this->isadmin = 1;
         $this->upname = \Admin\Service\User::getInstance()->username;
         $this->upuserid = \Admin\Service\User::getInstance()->id;
     } else {
         $this->upname = service('Passport')->username;
         $this->upuserid = service('Passport')->userid;
         $this->groupid = service('Passport')->groupid ? service('Passport')->groupid : 8;
     }
     parent::_initialize();
 }
コード例 #12
0
 public function index()
 {
     //中间广告位
     $this->assign('midad', parent::getAdvert(3, 1, 0, 1));
     //类别每日一荐
     $this->assign('catetj', D('Home/Works')->cateonework());
     //右上角广告
     $this->assign('righttopad', parent::getAdvert(3, 3, 0, 1));
     //焙友动态
     $this->userDynamicData = D('Home/User')->userDynamic(5);
     //热门活动
     $this->assign('activitytj', D('Home/Activity')->activitytj(2));
     //右边广告
     $this->assign('rightmidad', parent::getAdvert(3, 3, 1, 4));
     //分享达人
     $this->assign('sharedaren', D('Home/User')->sharedaren(5, $this->userid));
     $this->display();
 }
コード例 #13
0
 public function workslist($type, $url)
 {
     //中间广告位
     $this->assign('midad', parent::getAdvert(2, 1, 0, 1));
     $worksModel = M('Works');
     $where['status'] = array('EQ', true);
     $where['type'] = array('EQ', 1);
     $count = $worksModel->where($where)->count();
     $page = $this->Pages($count, 15);
     $pageurl = '?page=' . urlencode('[PAGE]');
     $page->url = __APP__ . '/dongtai/' . $url . '/' . $pageurl;
     $Model = new Model();
     $list = $Model->table(array(C('DB_PREFIX') . 'works' => 'W', C('DB_PREFIX') . 'user' => 'U'))->where('W.userid=U.userid and W.status=true and W.type=1')->field('W.title,W.content,W.goodnum,W.msgnum,W.workid,W.create_time,W.image,U.nickname,U.uavatar,U.openuid,U.uprovince,U.ucity,U.userid,U.ifrz')->order('' . $type . ' DESC')->limit($page->firstRow . ',' . $page->listRows)->select();
     foreach ($list as $key => $value) {
         $list[$key]['dignum'] = M('Dig')->where(array('status' => true, 'infoid' => $value['workid'], 'userid' => $this->userid))->count();
     }
     $this->pagecount = $page->totalRows / $page->listRows;
     $this->assign("list", $list);
     $this->assign("Page", $page->show());
 }
コード例 #14
0
ファイル: WorksController.class.php プロジェクト: gzwyufei/hp
 /**
  * 作品详情展示
  */
 public function detail()
 {
     $workid = I('get.workid');
     if (empty($workid)) {
         $this->error('您访问的页面不存在');
     }
     //增加点击数
     M('Works')->where(array('workid' => $workid))->setInc('clicknum');
     $detail = D('Works')->relation(true)->find($workid);
     if (!$detail) {
         $this->error('您访问的作品不存在');
     }
     //start yf
     $yf_thumb = array();
     $yf_pic = array();
     if (!empty($detail['all_pic'])) {
         $yf_arr = json_decode($detail['all_pic'], true);
         $yf_temp = array();
         foreach ($yf_arr as $k => $v) {
             $yf_thumb[] = $v;
             $yf_ex = explode("/", $v);
             $yf_ex[count($yf_ex) - 1] = str_replace("yf_", "", $yf_ex[count($yf_ex) - 1]);
             $yf_pic[] = implode("/", $yf_ex);
         }
     } else {
         $yf_arr = array();
         $yf_thumb[] = $yf_pic[] = $detail['image'];
     }
     $detail['pic_num'] = count($yf_thumb);
     $detail['thumb'] = implode(",", $yf_thumb);
     $detail['pic'] = implode(",", $yf_pic);
     $detail['WorksMaterials_count'] = count($detail['WorksMaterials']);
     //end
     $this->assign('data', $detail);
     //点赞总数
     $this->digallnum = $detail['goodnum'] + $detail['badnum'];
     //综合评价
     if ($detail['goodnum'] == 0 && $detail['badnum'] == 0) {
         $dig['digavg'] = 0;
         $dig['goodprecent'] = 50;
         $dig['badprecent'] = 50;
     } else {
         $digavg = round($detail['goodnum'] / ($detail['goodnum'] + $detail['badnum']), 2);
         $dig['digavg'] = $digavg * 10;
         $dig['goodprecent'] = $digavg * 100;
         $dig['badprecent'] = (1 - $digavg) * 100;
     }
     $this->dig = $dig;
     //点赞判断
     $this->digtype = M('Dig')->field('digtype,id')->where(array('userid' => $this->userid, 'status' => true, 'infoid' => $workid))->find();
     //收藏判断
     $this->favoritenum = getCount('UserFavorite', array('userid' => $this->userid, 'status' => true, 'infoid' => $workid));
     //右侧广告
     $this->rightad = parent::getAdvert(8, 3, 0, 2);
     //点赞人员列表
     $diguser = new Model();
     $diguerlist = $diguser->table(array(C('DB_PREFIX') . 'dig' => 'D', C('DB_PREFIX') . 'user' => 'U'))->where('D.userid=U.userid and D.status=true and D.digtype=1 and D.infoid=' . $workid . '')->field('U.uavatar,U.openuid')->select();
     $this->assign('diglist', $diguerlist);
     //评论
     $where['infoid'] = $workid;
     $where['type'] = 1;
     $where['parent_id'] = 0;
     $count = M('UserMessage')->where($where)->count();
     // $limitRows = 5; // 设置每页记录数
     $limitRows = C('YF_PAGE');
     $page = $this->ajaxpage($count, $limitRows, '#msg', 'ajax_div', 'ajax_page_div');
     $Model = new Model();
     $message = $Model->table(array(C('DB_PREFIX') . 'user_message' => 'M', C('DB_PREFIX') . 'user' => 'U'))->where('M.userid=U.userid and M.status=true and M.infoid=' . $workid . ' and M.type=1 and M.parent_id=0')->field('M.create_time,M.content,U.nickname,U.uavatar,U.openuid,U.uprovince,U.ucity,U.userid,M.id,M.touserid,U.ifrz')->order('M.create_time DESC')->limit($page->firstRow . ',' . $page->listRows)->select();
     foreach ($message as $k => $v) {
         $child_temp = array();
         $child_temp = $Model->table(C('DB_PREFIX') . 'user_message')->field('*')->where(array('parent_id' => $v['id']))->order('create_time ASC')->select();
         $message[$k]['childlist'] = array();
         if ($child_temp) {
             foreach ($child_temp as $yk => $yv) {
                 if ($yv['userid'] == 0) {
                     $child_temp[$yk]['nickname'] = "烘焙圈";
                     $child_temp[$yk]['openuid'] = 0;
                 } else {
                     $yf_user = array();
                     $yf_user = M('User')->field('openuid, nickname, uprovince, ucity, uavatar, ifrz')->where(array('userid' => $yv['userid']))->find();
                     $child_temp[$yk]['nickname'] = $yf_user['nickname'];
                     $child_temp[$yk]['openuid'] = $yf_user['openuid'];
                     $child_temp[$yk]['uprovince'] = $yf_user['uprovince'];
                     $child_temp[$yk]['ucity'] = $yf_user['ucity'];
                     $child_temp[$yk]['uavatar'] = $yf_user['uavatar'];
                     $child_temp[$yk]['ifrz'] = $yf_user['ifrz'];
                 }
                 if ($yv['touserid'] != 0) {
                     $child_temp[$yk]['touser'] = M('User')->field('openuid,nickname')->where(array('userid' => $yv['touserid']))->find();
                 } else {
                     $child_temp[$yk]['touser']['nickname'] = "烘焙圈";
                     $child_temp[$yk]['touser']['openuid'] = 0;
                 }
             }
             $message[$k]['childlist'] = $child_temp;
         }
         $message[$k]['tempname'] = hy_substr($v['nickname'], 4, true);
         //$message[$k]['tempname'] = $v['nickname'];
         $message[$k]['touser'] = array();
         if (!empty($v['touserid'])) {
             $message[$k]['touser'] = M('User')->field('openuid,nickname')->where(array('userid' => $v['touserid']))->find();
         }
     }
     unset($where['parent_id']);
     $this->msgcount = M('UserMessage')->where($where)->count();
     $this->msgtype = 1;
     $this->assign('msglist', $message);
     $this->assign('page', $page->show());
     if (IS_AJAX) {
         exit($this->fetch('msglist'));
     }
     //参照做出的作品
     $copylist = $Model->table(array(C('DB_PREFIX') . 'works' => 'W', C('DB_PREFIX') . 'user' => 'U'))->where('W.userid=U.userid and W.status=true and W.type=2 and W.copyid=' . $workid)->field('U.openuid,U.nickname,U.uavatar,W.title,W.image,W.workid,W.create_time,W.title')->order('W.workid DESC')->limit(2)->select();
     $this->copylist = $copylist;
     $this->display();
 }
コード例 #15
0
 /**
  * 业务逻辑都放在 WeiboApi 中
  * @var
  */
 protected function _initialize()
 {
     parent::_initialize();
     $tree = D('Issue')->getTree();
     $this->assign('tree', $tree);
 }
コード例 #16
0
ファイル: Html.class.php プロジェクト: sandom123/king400
 /**
  * 生成自定义列表页面
  * @param type $data
  * @return boolean
  */
 public function createListHtml($data = '')
 {
     if (empty($data)) {
         if (!empty($this->data)) {
             $data = $this->data;
             // 重置数据
             $this->data = array();
         } else {
             $this->error = '没有数据';
             return false;
         }
     } else {
         if (is_integer($data)) {
             $data = D('Template/Customlist')->where(array('id' => $data))->find();
             if (empty($data)) {
                 $this->error = '没有数据';
                 return false;
             }
         }
     }
     $model = D('Template/Customlist');
     //初始化一些模板分配变量
     $this->assignInitialize();
     //计算总数
     $countArray = $model->query($data['totalsql']);
     if (!empty($countArray)) {
         $count = $countArray[0]['total'];
     } else {
         return false;
     }
     //seo分配到模板
     $seo = seo(0, $data['title'], $data['description'], $data['keywords']);
     $this->assign("SEO", $seo);
     //分页总数
     $paging = ceil($count / $data['lencord']);
     $pagehao = 1;
     do {
         //生成路径
         $customlistUrl = $this->Url->createListUrl($data, $pagehao);
         if ($customlistUrl == false) {
             return false;
         }
         //取得URL规则
         $urls = $customlistUrl['page'];
         $page = page($count, $data['lencord'], $pagehao, array('isrule' => true, 'rule' => $urls));
         $listData = $model->query($data['listsql'] . " LIMIT {$page->firstRow},{$page->listRows}");
         //把分页分配到模板
         $this->assign(C("VAR_PAGE"), $pagehao);
         $this->assign('listData', $listData);
         $this->assign("pages", $page->show());
         if (empty($data['listpath'])) {
             //生成路径
             $htmlpath = SITE_PATH . $customlistUrl["path"];
             // 页面缓存
             ob_start();
             ob_implicit_flush(0);
             //渲染模板
             parent::show($data['template']);
             // 获取并清空缓存
             $content = ob_get_clean();
             //检查目录是否存在
             if (!is_dir(dirname($htmlpath))) {
                 // 如果静态目录不存在 则创建
                 mkdir(dirname($htmlpath), 0777, true);
             }
             //写入文件
             if (false === file_put_contents($htmlpath, $content)) {
                 throw_exception("自定义列表生成失败:" . $htmlpath);
             }
         } else {
             //去除完后缀的模板
             $template = TEMPLATE_PATH . (empty(self::$Cache["Config"]['theme']) ? "Default" : self::$Cache["Config"]['theme']) . "/Content/List/{$data['listpath']}";
             //模板检测
             $template = parseTemplateFile($template);
             //生成
             $this->buildHtml($customlistUrl['path'], SITE_PATH, $template);
         }
         $pagehao++;
     } while ($pagehao <= $paging);
     return true;
 }
コード例 #17
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->assign('nav', $this->getNav());
 }
コード例 #18
0
 /**
  * 随拍作品详情
  */
 public function detail()
 {
     $workid = I('get.workid');
     if (empty($workid)) {
         $this->error('您访问的页面不存在');
     }
     //增加点击数
     $model = M('Suipai');
     $model->where(array('id' => $workid))->setInc('clicknum');
     $detail = $model->find($workid);
     $unionModel = new Model();
     $detail = $unionModel->table(array(C('DB_PREFIX') . 'user' => 'U', C('DB_PREFIX') . 'suipai' => 'S'))->where('U.userid=S.userid and S.id=' . $workid)->field('U.nickname,U.uavatar,U.openuid,U.userid,U.ifrz,S.id,S.title,S.image,S.all_pic,S.content,S.clicknum,S.msgnum')->find();
     if (!$detail) {
         $this->error('您访问的作品不存在');
     }
     //start yf
     $yf_thumb = array();
     $yf_pic = array();
     if (!empty($detail['all_pic'])) {
         $yf_arr = json_decode($detail['all_pic'], true);
         $yf_temp = array();
         foreach ($yf_arr as $k => $v) {
             $yf_thumb[] = $v;
             $yf_ex = explode("/", $v);
             $yf_ex[count($yf_ex) - 1] = str_replace("yf_", "", $yf_ex[count($yf_ex) - 1]);
             $yf_pic[] = implode("/", $yf_ex);
         }
     } else {
         $yf_arr = array();
         $yf_thumb[] = $yf_pic[] = $detail['image'];
     }
     $detail['pic_num'] = count($yf_thumb);
     $detail['thumb'] = implode(",", $yf_thumb);
     $detail['pic'] = implode(",", $yf_pic);
     //end
     $this->assign('data', $detail);
     //关注数
     $this->fansnum = getCount('UserFans', array('userid' => $detail['userid'], 'status' => true));
     //右侧广告
     $this->rightad = parent::getAdvert(4, 3, 0, 1);
     //评论
     $where['infoid'] = $workid;
     $where['type'] = 4;
     $where['parent_id'] = 0;
     //yf 0915
     $count = M('UserMessage')->where($where)->count();
     // $limitRows = 5; // 设置每页记录数
     $limitRows = C('YF_PAGE');
     $page = $this->ajaxpage($count, $limitRows, '#msg', 'ajax_div', 'ajax_page_div');
     $message = $unionModel->table(array(C('DB_PREFIX') . 'user_message' => 'M', C('DB_PREFIX') . 'user' => 'U'))->where('M.userid=U.userid and M.status=true and M.infoid=' . $workid . ' and M.type=4 and M.parent_id=0')->field('M.create_time,M.content,U.nickname,U.uavatar,U.openuid,U.uprovince,U.ucity,U.userid,M.id,M.touserid')->order('M.create_time DESC')->limit($page->firstRow . ',' . $page->listRows)->select();
     //         foreach($message as $k=>$v){
     //             $message[$k]['touser']=M('User')->field('openuid,nickname')->where(array('userid'=>$v['touserid']))->find();
     //         }
     foreach ($message as $k => $v) {
         $child_temp = array();
         $child_temp = $unionModel->table(C('DB_PREFIX') . 'user_message')->field('*')->where(array('parent_id' => $v['id']))->order('create_time ASC')->select();
         $message[$k]['childlist'] = array();
         if ($child_temp) {
             foreach ($child_temp as $yk => $yv) {
                 if ($yv['userid'] == 0) {
                     $child_temp[$yk]['nickname'] = "烘焙圈";
                     $child_temp[$yk]['openuid'] = 0;
                 } else {
                     $yf_user = array();
                     $yf_user = M('User')->field('openuid, nickname, uprovince, ucity, uavatar, ifrz')->where(array('userid' => $yv['userid']))->find();
                     $child_temp[$yk]['nickname'] = $yf_user['nickname'];
                     $child_temp[$yk]['openuid'] = $yf_user['openuid'];
                     $child_temp[$yk]['uprovince'] = $yf_user['uprovince'];
                     $child_temp[$yk]['ucity'] = $yf_user['ucity'];
                     $child_temp[$yk]['uavatar'] = $yf_user['uavatar'];
                     $child_temp[$yk]['ifrz'] = $yf_user['ifrz'];
                 }
                 if ($yv['touserid'] != 0) {
                     $child_temp[$yk]['touser'] = M('User')->field('openuid,nickname')->where(array('userid' => $yv['touserid']))->find();
                 } else {
                     $child_temp[$yk]['touser']['nickname'] = "烘焙圈";
                     $child_temp[$yk]['touser']['openuid'] = 0;
                 }
             }
             $message[$k]['childlist'] = $child_temp;
         }
         $message[$k]['tempname'] = hy_substr($v['nickname'], 4, true);
         //$message[$k]['tempname'] = $v['nickname'];
         $message[$k]['touser'] = array();
         if (!empty($v['touserid'])) {
             $message[$k]['touser'] = M('User')->field('openuid,nickname')->where(array('userid' => $v['touserid']))->find();
         }
     }
     unset($where['parent_id']);
     $this->msgcount = M('UserMessage')->where($where)->count();
     $this->msgtype = 4;
     $this->assign('msglist', $message);
     $this->assign('page', $page->show());
     if (IS_AJAX) {
         exit($this->fetch('msglist'));
         //list为list.html模版
     }
     //获取会员烘焙作品数
     $this->hbworksnum = getCount('Works', array('status' => true, 'type' => 1, 'userid' => $detail['userid']));
     //获取会员随拍作品数
     $this->spworksnum = getCount('Suipai', array('status' => true, 'userid' => $detail['userid']));
     //是否关注
     $this->isfans = getCount('UserFans', array('myid' => $this->userid, 'userid' => $detail['userid'], 'status' => true));
     //更多随拍作品
     $map['status'] = array('EQ', true);
     $map['userid'] = array('EQ', $detail['userid']);
     $map['id'] = array('NEQ', $workid);
     $this->moresp = M('Suipai')->field('image,id')->where($map)->limit(6)->select();
     $this->display();
 }
コード例 #19
0
 /**
  * 后台控制器初始化
  */
 protected function _initialize()
 {
     parent::_initialize();
     $this->_adminInit();
 }
コード例 #20
0
ファイル: Core.class.php プロジェクト: admpub/OpenCenter
 protected function _initialize()
 {
     parent::_initialize();
 }