예제 #1
0
 public function __construct()
 {
     parent::__construct();
     if (!C('register_is_enable')) {
         $this->error('注册已关闭');
     }
 }
 protected function _initialize()
 {
     parent::_initialize();
     /**
      * 获取用户的信息
      */
     //获取用户id
     $user_id = session('user_auth')['uid'];
     I('uid') && ($user_id = I('uid'));
     //如果没有传用户id,则获取的是自己的资料,否则获取的是其他人的用户资料
     //获取用户的具体信息
     $map = array();
     $map['uid'] = $user_id;
     $user = M('User')->where($map)->find();
     //获取共有几个相册
     $user['album_num'] = M('Album')->where($map)->count();
     //获取共有几张照片
     $user['pic_num'] = M('Pic')->where($map)->count();
     //获取收藏
     $user['collect_num'] = M('Collect')->where($map)->count();
     $this->assign('user', $user);
     //判断查看的是登录者的信息 ,,,还是别人的信息
     if ($user_id != session('user_auth')['uid']) {
         $this->assign('user_self', false);
     } else {
         $this->assign('user_self', true);
     }
 }
예제 #3
0
 public function __autoload()
 {
     parent::__autoload();
     $banner = getBanner('home');
     $advert = getBanner('advert');
     $news = get_recommend_articles('news', 9);
     $notice = get_recommend_articles('notice', 9);
     /*个人译者店铺*/
     $shop_personal = get_recommend_shop(1);
     /*公司店铺*/
     $shop_company = get_recommend_shop();
     $shop_new = get_new_shop();
     $written_shop = $this->recommend_shop(36);
     $interpreter_shop = $this->recommend_shop(37);
     /*获取网站指数*/
     $site_index = get_site_index();
     $data['site_index'] = $site_index;
     $data['home_banner'] = $banner;
     $data['advert'] = $advert;
     $data['news'] = $news;
     $data['notice'] = $notice;
     $data['shop_personal'] = $shop_personal;
     $data['shop_company'] = $shop_company;
     $data['shop_new'] = $shop_new;
     $data['written_shop'] = $written_shop;
     $data['interpreter_shop'] = $interpreter_shop;
     $this->info = $data;
     $this->assign($data);
 }
예제 #4
0
 function __construct()
 {
     $this->homeController = HomeController::getSingleton();
     $this->createHomePostType();
     add_action('add_meta_boxes_' . self::HOME_POST_TYPE, array(&$this, 'addMetaBoxes'));
     add_action('save_post', array(&$this->homeController, 'save'));
 }
예제 #5
0
 public function __autoload()
 {
     parent::__autoload();
     $this->product_type = list_to_tree(get_ability_cache());
     /* 获取缓存的分类属性转换为树状 */
     $this->first_step_view = array('36' => 'step_1_written', '37' => 'step_1_interpret', '56' => 'step_1_audio');
 }
예제 #6
0
 /**
  * 初始化方法
  * @author jry <*****@*****.**>
  */
 protected function _initialize()
 {
     parent::_initialize();
     $map['status'] = 1;
     $map['type'] = 1;
     $addon_list = D('Addon')->where($map)->select();
     $this->assign('addon_list', $addon_list);
 }
예제 #7
0
 function __construct()
 {
     parent::__construct();
     $this->uid = is_login();
     if (!$this->uid && ACTION_NAME != 'profile') {
         $this->redirect('User/login');
     }
     $this->pageTitle = "用户中心";
 }
 public function __construct()
 {
     parent::__construct();
     if (!C('register_is_enable')) {
         $this->error('注册已关闭');
     }
     if (!UID) {
         session('error', '您还没有登陆');
         $this->redirect(U('User/login'));
     }
 }
예제 #9
0
 public function _initialize()
 {
     //执行父类的初始化函数
     parent::_initialize();
     //获取所有的分类
     $type_list = M('AlbumType')->select();
     $this->assign('type_list', $type_list);
     //获取当前的分类
     $now_type = I('type') ? I('type') : 1;
     //默认1分类
     $this->assign('now_type', $now_type);
 }
예제 #10
0
 public function __construct()
 {
     parent::__construct();
     $this->topicModel = M("topic");
     $this->imageModel = M("image");
     $this->noticeModel = M("notice");
     $this->vipModel = M("privilege");
     $this->questionModel = M("question");
     $this->classifiModel = M("classifi");
     $this->bannelModel = M("bannel");
     //流量记录
     $this->flowModel = D("flow");
 }
예제 #11
0
 public function _initialize()
 {
     parent::_initialize();
     $this->assign('check_all', false);
     $this->assign('search_url', U('lists'));
     define('ADDON_PUBLIC_PATH', '');
     defined('_ADDONS') or define('_ADDONS', MODULE_NAME);
     defined('_CONTROLLER') or define('_CONTROLLER', CONTROLLER_NAME);
     defined('_ACTION') or define('_ACTION', ACTION_NAME);
     $this->model = M('model')->getByName('public');
     $this->assign('model', $this->model);
     $res['title'] = '公众号管理';
     $res['url'] = U('lists');
     $res['class'] = 'current';
     $nav[] = $res;
     $this->assign('nav', $nav);
     // dump ( $this->model );
 }
예제 #12
0
 public function __construct()
 {
     parent::__construct();
 }
예제 #13
0
 public function __autoload()
 {
     parent::__autoload();
     $this->seller_type = array('1' => '个人', '2' => '公司');
     $this->search = array('language_id' => '', 'to_language_id' => '', 'ability_id' => '', 'industry_id' => '', 'type' => '', 'city' => '');
     $this->product_type = list_to_tree(get_ability_cache());
     /*获取缓存的分类属性转换为树状*/
     $this->shop_id = I('shop_id');
     if (session('home_member_id')) {
         $info_k = get_info('member', array('id' => session('home_member_id')));
         $this->member_info = $info_k;
     }
     $shop_info = $this->get_shop_description();
     //店铺信息
     // 		dump($shop_info);die;
     $shop_id = I('shop_id');
     if ($shop_id) {
         /*查询店铺信息*/
         $shop_info = get_info(D($this->member_model), array('id' => $shop_id));
         if (empty($shop_info)) {
             $this->error('店铺信息不存在');
         } else {
             if (empty($shop_info['seller_id'])) {
                 $this->error('店铺信息不存在');
             } else {
                 if ($shop_info and $shop_info["shop_status"] != 1) {
                     if ($shop_info["shop_status"] == 2) {
                         $this->error("该店铺已被禁用");
                     } else {
                         $this->error("该店铺暂未开通");
                     }
                 }
             }
         }
         // 			dump($shop_info);
         //查询地理信息
         $area_data = get_area_cache();
         $area_list = list_to_tree($area_data);
         //查询店铺的地理信息
         $shop_area_id = $shop_info['area_id'];
         foreach ($area_list as $val) {
             foreach ($val['_child'] as $v) {
                 foreach ($v['_child'] as $vv) {
                     if ($vv['id'] == $shop_area_id) {
                         $shop_info['city'] = $v['title'];
                         $shop_info['province'] = $val['title'];
                         $shop_info['area'] = $vv["title"];
                         $city_data = $val['_child'];
                         $area_k = $v['_child'];
                     }
                 }
             }
         }
         /*获取过往经历*/
         $result1 = get_experience($shop_id, 1);
         if ($result1['status'] == 1) {
             $shop_info_old = $result1['shop_info'];
         }
         /*获取成功分享*/
         $result2 = get_experience($shop_id, 2);
         if ($result2['status'] == 1) {
             $shop_info_new = $result2['shop_info'];
         }
         /*获取语言信息*/
         $language = get_language_cache();
         /*获取技能信息*/
         $ability = list_to_tree(get_ability_cache());
         /*获取行业信息*/
         $industry = get_industry_cache();
         /*获取数组键值为语言ID的新数组*/
         foreach ($language as $val) {
             $language_id_key[$val['id']] = $val;
         }
         /*处理擅长语言*/
         $good_at = json_decode($shop_info['good_at'], true);
         foreach ($good_at as $k => $v) {
             $good_at_new[$k]['id'] = $v;
             $good_at_new[$k]['title'] = $language_id_key[$v]['title'];
         }
         $shop_info['good_at_arr'] = $good_at_new;
         /*处理店铺logo*/
         if (is_file($shop_info['logo'])) {
             $shop_info['logo'] = __ROOT__ . '/' . $shop_info['logo'];
         } else {
             $shop_info['logo'] = __ROOT__ . '/Public/Home/img/company_img.jpg';
         }
         /*处理数字值,将数字转化为文字*/
         $temp[0] = $shop_info;
         $temp = int_to_string($temp, array('type' => $this->seller_type));
         $shop_info = $temp[0];
         //print_r($product_result);
         $data['shop_info_1'] = $shop_info;
         // 			dump($shop_info);die;
         //获取店铺收藏信息
         $show_result = get_info('collect', array('collect_id' => $this->shop_id));
         // 			dump($show_result);die;
         $hot_product = get_hot_product($shop_id);
         //@赵群@查询地理信息
         $map2['member.id'] = array('gt', 0);
         $result = $this->page(D($this->member_model), $map2, $order, '', $this->limit);
         $area = get_area_cache();
         $area_id_key = array_id_key($area);
         $address_data = array();
         foreach ($result as $key => $value) {
             $address_data[] = get_info('address', array('member_id' => $value['member_id']), $field = array('member_id', 'area_path'));
         }
         foreach ($address_data as $key => $value) {
             $address_arr = $value['area_path'];
             $path = explode('-', $address_arr);
             $new_address = $area_id_key[$path['2']]['title'] . $area_id_key[$path['3']]['title'] . $area_id_key[$path['4']]['title'];
             $address_data[$key]['path'] = $new_address;
         }
         // 			dump($address_data);die;
         $data['result'] = $result;
         $data['hot_product'] = $hot_product;
         $data['shop_info_old'] = $shop_info_old;
         $data['shop_info_new'] = $shop_info_new;
         $data['show_result'] = $show_result;
         $this->assign($data)->assign('address_data', $address_data);
     }
 }
 /**
  * 设置一条或者多条数据的状态
  * @author jry <*****@*****.**>
  */
 public function setStatus($model = CONTROLLER_NAME)
 {
     $ids = I('request.ids');
     $status = I('request.status');
     if (empty($ids)) {
         $this->error('请选择要操作的数据');
     }
     $map['id'] = array('in', $ids);
     switch ($status) {
         case 'delete':
             // 删除条目
             $map['status'] = -1;
             $info = D('Index')->detail($ids, $map);
             $extend_table_object = D(strtolower(D('Index')->moduleName . '_' . $info['doc_type_info']['name']));
             $exist = $extend_table_object->find($ids);
             if ($exist) {
                 $result = $extend_table_object->delete($ids);
             } else {
                 $result = true;
             }
             if ($result) {
                 $result2 = D('Index')->delete($ids);
                 if ($result2) {
                     $this->success('彻底删除成功');
                 } else {
                     $this->error('删除失败');
                 }
             } else {
                 $this->error('删除失败');
             }
             break;
         default:
             parent::setStatus($model);
             break;
     }
 }
예제 #15
0
 public function __autoload()
 {
     parent::__autoload();
     $this->product_type = list_to_tree(get_ability_cache());
     /*获取缓存的分类属性转换为树状*/
 }
예제 #16
0
 public function _initialize()
 {
     $config = array('accessKey' => C('ACCESS_KEY'), 'secrectKey' => C('SECRET_KEY'), 'bucket' => C('BUCKET'), 'domain' => C('QINIUDOMAIN'));
     $this->qiniu = new QiniuStorage($config);
     parent::_initialize();
 }
예제 #17
0
 public function _initialize()
 {
     parent::_initialize();
 }
 /**
  * 初始化方法
  * @author jry <*****@*****.**>
  */
 protected function _initialize()
 {
     parent::_initialize();
     $this->is_login();
 }
예제 #19
0
 public function __autoload()
 {
     parent::__autoload();
     $this->seller_type = array('1' => '个人', '2' => '公司');
 }