Пример #1
0
	public function index(){
		$where=array('agentid'=>$this->agentid);
		$groups=M('User_group')->where($where)->order('id ASC')->select();
		$this->assign('groups',$groups);
		if(class_exists('updateSync')){
			$result = updateSync::getIfWeidian();
			$this->assign('load_config',$result);
		}
		$this->display();
	}
Пример #2
0
 public function _initialize()
 {
     parent::_initialize();
     if (updateSync::getIfWeidian()) {
         $this->Micrstore_URL = C('weidian_domain') ? C('weidian_domain') : 'http://v.meihua.com';
         $this->SALT = C('encryption') ? C('encryption') : 'pigcms';
     } else {
         $this->Micrstore_URL = 'http://v.meihua.com';
         $this->SALT = 'pigcms';
     }
 }
Пример #3
0
	public function menus()
	{
		$top = array();
		$homeLink = '?g=Agent&m=Index&a=home';
		$top['basic'] = array('text' => '基本信息', 'link' => $homeLink);
		$top['user'] = array('text' => '用户管理', 'link' => '?g=Agent&m=Users&a=index');
		$top['site'] = array('text' => '站点管理', 'link' => '?g=Agent&m=Site&a=index');
		$version = updateSync::version();
		if ((LEVEL_ID == 0) && ($version == 5)) {
			$top['level'] = array('text' => '代理商管理', 'link' => '?g=Agent&m=Level&a=index');
		}

		return $top;
	}
Пример #4
0
 public function _initialize()
 {
     parent::_initialize();
     $this->where = array('token' => $this->token);
     $this->modules = array('Home' => '首页', 'Classify' => '网站分类', 'Img' => '图文回复', 'Company' => 'LBS信息', 'Live' => '微场景', 'Adma' => 'DIY宣传页', 'Photo' => '相册', 'Selfform' => '万能表单', 'Host' => '商家订单', 'Groupon' => '团购', 'Shop' => '商城', 'Storenew' => '分销商城', 'Jingpai' => '商城竞拍', 'Repast' => '订餐', 'Wedding' => '婚庆喜帖', 'Vote' => '投票', 'Panorama' => '全景', 'Lottery' => '大转盘', 'Guajiang' => '刮刮卡', 'Coupon' => '优惠券', 'MemberCard' => '会员卡', 'Estate' => '微房产', 'Message' => '留言板', 'Car' => '汽车', 'GoldenEgg' => '砸金蛋', 'LuckyFruit' => '水果机', 'AppleGame' => '走鹊桥', 'Lovers' => '摁死情侣', 'Autumn' => '吃月饼', 'Problem' => '一战到底', 'Forum' => '论坛', 'GreetingCard' => '贺卡', 'Medical' => '微医疗', 'School' => '微教育', 'Hotels' => '酒店宾馆', 'Business' => '行业应用', 'Market' => '微商圈', 'Research' => '微调研', 'Fansign' => '微信签到', 'OutsideLink' => '<font color="red">生活服务</font>');
     if (C('server_topdomain') == C('server_topdomain')) {
         //demo settings
         $this->arr = array('game', 'Invite', 'Red_packet', 'Seckill', 'Autumns', 'Popularity', 'Helping', 'Jiugong', 'MicroBroker', 'Crowdfunding', "Unitary", "DishOut", "LivingCircle", "Test", "Bargain", "Service", "Hongbao", "Micrstore", "SeniorScene", "SeniorCard", "ServiceChat", "Voteimg");
     } else {
         if (!is_file(RUNTIME_PATH . 'function_library.php')) {
             updateSync::sync_function_library();
         }
         $this->arr = (require RUNTIME_PATH . 'function_library.php');
     }
 }
Пример #5
0
 private function apiMicrstorePayNofity($data)
 {
     function callback($v)
     {
         if (empty($v)) {
             return $v = '';
         } else {
             return $v;
         }
     }
     if (updateSync::getIfWeidian()) {
         $Micrstore_URL = C('weidian_domain') ? C('weidian_domain') : 'http://v.meihua.com';
         $SALT = C('encryption') ? C('encryption') : 'pigcms';
     } else {
         $Micrstore_URL = 'http://v.meihua.com';
         $SALT = 'pigcms';
     }
     $sort_data = $data;
     $sort_data['salt'] = $SALT;
     ksort($sort_data);
     $sort_data = array_map('callback', $sort_data);
     $sign_key = sha1(http_build_query($sort_data));
     $data['sign_key'] = $sign_key;
     $data['request_time'] = time();
     $url = $Micrstore_URL . "/api/pay_notify.php";
     //微店接收数据的地址
     $return = json_decode($this->curl_post($url, $data), true);
     //微店返回数据
 }
Пример #6
0
	public function index(){
		//
		$firstNode=M('Node')->where(array('pid'=>1,'title'=>'代理商管理'))->order('id ASC')->find();
		$nodeExist=M('Node')->where(array('pid'=>$firstNode['id'],'title'=>'优惠套餐包'))->find();
		if (!$nodeExist){
			$submenu=array(
			'name'=>'AgentPrice',
			'title'=>'优惠套餐包',
			'status'=>1,
			'remark'=>'0',
			'pid'=>$firstNode['id'],
			'level'=>2,
			'sort'=>0,
			'display'=>2
			);
			$submenuRowID=M('Node')->add($submenu);
			//
			$row2=array(
			'name'=>'add',
			'title'=>'添加',
			'status'=>1,
			'remark'=>'0',
			'pid'=>$submenuRowID,
			'level'=>3,
			'sort'=>0,
			'display'=>2
			);
			M('Node')->add($row2);
		}
		$buyRecordNode=M('Node')->where(array('pid'=>$firstNode['id'],'title'=>'消费记录'))->find();
		if (!$buyRecordNode){
			$submenu=array(
			'name'=>'AgentBuyRecords',
			'title'=>'消费记录',
			'status'=>1,
			'remark'=>'0',
			'pid'=>$firstNode['id'],
			'level'=>2,
			'sort'=>0,
			'display'=>2
			);
			$submenuRowID=M('Node')->add($submenu);
		}
		//
		$count=$this->agent_db->count();
		$page=new Page($count,20);
		$agentWhere = array('level'=>0);
		if ($_GET['agentid']){
			$agentWhere['level'] = (int)$_GET['agentid'];
		}
		
		$info=$this->agent_db->where($agentWhere)->order('id DESC')->limit($page->firstRow.','.$page->listRows)->select();
		$i=0;
		$version = updateSync::version();//获取版本号
		if ($info){
			foreach ($info as $item){
				$info[$i]['usercount']=M('Users')->where(array('agentid'=>intval($item['id'])))->count();
				$info[$i]['wxusercount']=M('Wxuser')->where(array('agentid'=>intval($item['id'])))->count();
				$info[$i]['level'] = $version == 5 ? $item['level'] : 1;
				$i++;
			}
		}
		$this->assign('info',$info);
		$this->assign('page',$page->show());
		$this->display();
	}