Beispiel #1
0
 /**
  * ajax获得指定数据
  */
 public function doAjaxData(ZOL_Request $input, ZOL_Response $output)
 {
     $id = (int) $input->get('id');
     $arr = Helper_Dao::getRows(array('dbName' => "Db_Andyou", 'tblName' => "membercate", 'cols' => "*", 'whereSql' => ' and id=' . $id));
     //数据补充
     if ($arr) {
         foreach ($arr as $k => $v) {
             if ($v["discountStr"]) {
                 $tmparr = json_decode($v["discountStr"], true);
                 foreach ($tmparr as $i => $iv) {
                     $arr[$k]["disc_" . $i] = $iv;
                 }
             }
         }
     }
     $data = ZOL_String::convToU8($arr);
     if (isset($data[0])) {
         echo json_encode($data[0]);
     }
     exit;
 }
Beispiel #2
0
 /**
  * ajax获得指定数据
  */
 public function doAjaxData(ZOL_Request $input, ZOL_Response $output)
 {
     $id = (int) $input->get('id');
     $arr = Helper_Dao::getRows(array('dbName' => "Db_Andyou", 'tblName' => "staffcate", 'cols' => "*", 'whereSql' => ' and id=' . $id));
     $data = ZOL_String::convToU8($arr);
     if (isset($data[0])) {
         echo json_encode($data[0]);
     }
     exit;
 }
Beispiel #3
0
 /**
  * 推送ios设备消息
  * @param type $paramArr
  */
 public static function pushMessageIos($paramArr)
 {
     $options = array('apiKey' => '', 'secretKey' => '', 'alert' => '', 'pushType' => '', 'userId' => '', 'tagName' => '', 'channelId' => '', 'messageType' => '');
     if (is_array($paramArr)) {
         $options = array_merge($options, $paramArr);
     }
     extract($options);
     $channel = new Channel($apiKey, $secretKey);
     $push_type = $pushType;
     //推送单播消息
     //如果推送单播消息,需要指定user
     if ($userId) {
         $optional[Channel::USER_ID] = $userId;
     }
     //如果推送tag消息,需要指定tag_name
     if ($tagName) {
         $optional[Channel::TAG_NAME] = $tagName;
     }
     //指定发到ios设备
     $optional[Channel::DEVICE_TYPE] = 4;
     //指定消息类型为通知
     $optional[Channel::MESSAGE_TYPE] = $messageType;
     //如果ios应用当前部署状态为开发状态,指定DEPLOY_STATUS为1,默认是生产状态,值为2.
     //旧版本曾采用不同的域名区分部署状态,仍然支持。
     $optional[Channel::DEPLOY_STATUS] = 1;
     //通知类型的内容必须按指定内容发送,示例如下:
     $message = '{ 
         "aps":{
             "alert":"' . ZOL_String::convToU8($alert) . '",
             "sound":"",
             "badge":0
         }
     }';
     $message_key = "msg_key";
     $ret = $channel->pushMessage($push_type, $message, $message_key, $optional);
     return $ret;
 }