public function unfavoriteShop_delete() { $uid = $this->get('uid'); $shopId = $this->get('shopId'); // if (empty($uid) || empty($shopId)) { return outputError(-1, '没有用户信息或商户信息'); } // 获得recordId $value = array('people' => avosPointer('_User', $uid), 'shop' => avosPointer('Shop', $shopId)); $json = $this->kq->retrieveObjects('FavoritedShop', json_encode($value)); $error = checkResponseError($json); if (!empty($error)) { return $error; } $results = resultsWithJson($json); foreach ($results as $result) { $recordId = $result['objectId']; $this->kq->deleteObject('FavoritedShop', $recordId); } return output_success_response('1'); }
/** * 如果 * @param unknown_type $id */ public function delete($id, $parentId) { if (!empty($parentId)) { $this->avoslibary->removePointerInArray('CouponType', $parentId, 'subType', avosPointer('CouponType', $id)); $error = checkResponseError($json); if (!empty($error)) { return false; } } $json = $this->avoslibrary->deleteObject('CouponType', $id); $error = checkResponseError($json); if (!empty($error)) { return false; } return true; }
/** * * 返回总店的所有分店信息 * 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); }
/** * 如果 * @param unknown_type $id */ public function delete($id) { $json = $this->avoslibrary->deleteObject('District', $id); $error = checkResponseError($json); if (!empty($error)) { return false; } return true; }