Exemplo n.º 1
0
 public static function defaultImg($img_type, $zl = '')
 {
     switch ($img_type) {
         //首页
         case MonUtil::$IMG_SHARE_BG:
             if (!empty($zl) && !empty($zl['share_bg'])) {
                 return MonUtil::getpicurl($zl['share_bg']);
             }
             $img_name = "guide.png";
             break;
     }
     return "../addons/mon_qmshake/images/" . $img_name;
 }
Exemplo n.º 2
0
 public function respond()
 {
     $rid = $this->rule;
     $wkj = pdo_fetch("select * from " . tablename(DBUtil::$TABLE_WKJ) . " where rid=:rid", array(":rid" => $rid));
     if (!empty($wkj)) {
         $news = array();
         $news[] = array('title' => $wkj['new_title'], 'description' => $wkj['new_content'], 'picurl' => MonUtil::getpicurl($wkj['new_icon']), 'url' => $this->createMobileUrl('auth', array('kid' => $wkj['id'], 'au' => Value::$REDIRECT_USER_INDEX)));
         return $this->respNews($news);
     } else {
         return $this->respText("砍价活动不存在或删除");
     }
     return null;
 }
Exemplo n.º 3
0
 public function respond()
 {
     $rid = $this->rule;
     $order = pdo_fetch("select * from " . tablename(DBUtil::$TABLE_ORDER_FORM) . " where rid=:rid", array(":rid" => $rid));
     if (!empty($order)) {
         $news = array();
         $news[] = array('title' => $order['new_title'], 'description' => $order['new_content'], 'picurl' => MonUtil::getpicurl($order['new_icon']), 'url' => $this->createMobileUrl('Index', array('fid' => $order['id'])));
         return $this->respNews($news);
     } else {
         return $this->respText("订单不不存在");
     }
     return null;
 }
Exemplo n.º 4
0
 public function respond()
 {
     $rid = $this->rule;
     $egg = pdo_fetch("select * from " . tablename(DBUtil::$TABLE_EGG) . " where rid=:rid", array(":rid" => $rid));
     if (!empty($egg)) {
         if (TIMESTAMP < $egg['starttime']) {
             return $this->respText("砸金蛋活动未开始!");
         }
         $news = array();
         $news[] = array('title' => $egg['new_title'], 'description' => $egg['new_content'], 'picurl' => MonUtil::getpicurl($egg['new_icon']), 'url' => $this->createMobileUrl('Index', array('egid' => $egg['id'])));
         return $this->respNews($news);
     } else {
         return $this->respText("砸金蛋活动未开始");
     }
     return null;
 }
Exemplo n.º 5
0
 public function getClientUserInfo($openid)
 {
     global $_W;
     if (!empty($openid) && ($_W['account']['level'] == 3 || $_W['account']['level'] == 4)) {
         load()->classs('weixin.account');
         $accObj = WeixinAccount::create($_W['acid']);
         $access_token = $accObj->fetch_token();
         if (empty($access_token)) {
             message("获取accessToken失败");
         }
         $userInfo = $this->oauth->getUserInfo($access_token, $openid);
         MonUtil::setClientCookieUserInfo($userInfo, $this::$USER_COOKIE_KEY);
         return $userInfo;
     }
 }
Exemplo n.º 6
0
 public function getCookieUserInof($zid)
 {
     $cookieUserInfo = MonUtil::getClientCookieUserInfo($this::$USER_COOKIE_KEY . "" . $zid);
     return $cookieUserInfo;
 }
Exemplo n.º 7
0
 public static function defaultImg($img_type, $egg = '')
 {
     switch ($img_type) {
         //首页
         case MonUtil::$IMG_BANNER_BG:
             if (!empty($egg) && !empty($egg['banner_bg'])) {
                 return MonUtil::getpicurl($egg['banner_bg']);
             }
             $img_name = "banner.jpg";
             break;
         case MonUtil::$IMG_BG:
             if (!empty($egg) && !empty($egg['bg_img'])) {
                 return MonUtil::getpicurl($egg['bg_img']);
             }
             $img_name = "bg.jpg";
             break;
         case MonUtil::$IMG_SHARE_BG:
             if (!empty($egg) && !empty($egg['share_bg'])) {
                 return MonUtil::getpicurl($egg['share_bg']);
             }
             $img_name = "guide.png";
             break;
     }
     return "../addons/mon_egg/images/" . $img_name;
 }
Exemplo n.º 8
0
 /**
  * author: codeMonkey QQ:631872807
  * @param $type
  * 获取转向URL
  */
 public function getRedirectUrl($type, $parmas = array())
 {
     switch ($type) {
         case Value::$REDIRECT_USER_INDEX:
             //首页
             $redirectUrl = $this->createMobileUrl('index', $parmas, true);
             break;
         case Value::$REDIRECT_KJ:
             $redirectUrl = $this->createMobileUrl('kj', $parmas, true);
             breka;
     }
     return MonUtil::str_murl($redirectUrl);
 }