コード例 #1
0
ファイル: ctype_m.php プロジェクト: iHamburg/kqserver
 public function get_all()
 {
     $url = HOST . '/classes/CouponType';
     $json = $this->avoslibrary->get($url);
     checkResponseError($json);
     $results = resultsWithJson($json);
     return $results;
 }
コード例 #2
0
ファイル: kqapi.php プロジェクト: iHamburg/kqserver
 private function isCouponFavorited($uid = '', $couponId = '')
 {
     $value = array('people' => avosPointer('_User', $uid), 'coupon' => avosPointer('Coupon', $couponId));
     $json = $this->kq->retrieveObjects('FavoritedCoupon', json_encode($value));
     $results = resultsWithJson($json);
     if (empty($results)) {
         return false;
     } else {
         return true;
     }
 }
コード例 #3
0
ファイル: kqapi3.php プロジェクト: iHamburg/kqserver
 /**
  * 
  * 返回总店的所有分店信息
  * param: parentId
  */
 public function shopbranches_get()
 {
     $url = HOST . "/classes/Shop?";
     $parentId = $this->get('parentId');
     if (empty($parentId)) {
         outputError(-1, '没有总店信息');
     }
     $where = array('parent' => avosPointer('Shop', $parentId));
     $url .= 'where=' . json_encode($where);
     $json = $this->kq->get($url);
     $error = checkResponseError($json);
     if (!empty($error)) {
         return $error;
     }
     $results = resultsWithJson($json);
     foreach ($results as $result) {
         $array[] = array_slice_keys($result, array('title', 'objectId', 'phone', 'address', 'openTime', 'location'));
     }
     if (!isLocalhost()) {
         $this->output->cache(CacheTime);
     }
     return $this->output_results($array);
 }
コード例 #4
0
ファイル: avoslibrary.php プロジェクト: iHamburg/kqserver
 /**
  * 返回判断field是否有xxvalue
  * @param unknown_type $className
  * @param unknown_type $field
  * @param id $value
  */
 function isFieldHasValue($className, $field, $value)
 {
     $where = array($field => $value);
     $json = $this->retrieveObjects($className, json_encode($where));
     $results = resultsWithJson($json);
     if (empty($results)) {
         return false;
     } else {
         return true;
     }
 }