public function actionIndex() { /*$post_data = ebay::getRequestAuthHead(Yii::APP()->params['ebay']['ebay-discount']['tokens']['ebay-discount'], 'GetShippingDiscountProfiles'); $post_data .= ebay::getRequestAuthFoot('GetShippingDiscountProfiles'); $httpHead = array(); $httpHead['SITEID'] = Yii::APP()->params['ebay']['SiteID']['MOTO']; $httpHead['COMPATIBILITYLEVEL'] = Yii::APP()->params['ebay']['ebay-discount']['COMPATIBILITYLEVEL']; $httpHead['DEVID'] = Yii::APP()->params['ebay']['ebay-discount']['keys']['lof']["DEVID"]; $httpHead['AppID'] = Yii::APP()->params['ebay']['ebay-discount']['keys']['lof']["AppID"]; $httpHead['CertID'] = Yii::APP()->params['ebay']['ebay-discount']['keys']['lof']["CertID"]; $httpHead['API_URL'] = Yii::APP()->params['ebay']['ebay-discount']['API_URL']; $result = ebay::curl_request($post_data, $httpHead, 'GetShippingDiscountProfiles', false);*/ /*$post_data = ebay::getRequestAuthHead(Yii::APP()->params['ebay']['production']['tokens']['himerus.wish'], 'GetShippingDiscountProfiles'); $post_data .= ebay::getRequestAuthFoot('GetShippingDiscountProfiles'); $httpHead = array(); $httpHead['SITEID'] = Yii::APP()->params['ebay']['SiteID']['US']; $httpHead['COMPATIBILITYLEVEL'] = Yii::APP()->params['ebay']['production']['COMPATIBILITYLEVEL']; $httpHead['DEVID'] = Yii::APP()->params['ebay']['production']['keys']['prod key set']["DEVID"]; $httpHead['AppID'] = Yii::APP()->params['ebay']['production']['keys']['prod key set']["AppID"]; $httpHead['CertID'] = Yii::APP()->params['ebay']['production']['keys']['prod key set']["CertID"]; $httpHead['API_URL'] = Yii::APP()->params['ebay']['production']['API_URL']; $result = ebay::curl_request($post_data, $httpHead, 'GetShippingDiscountProfiles', false); var_dump($result);die();*/ $listing = eBayListing::model()->findByPk(1); var_dump($listing, $listing->eBayEntityType, $listing->eBayAttributeSet); die; $this->render('index'); }
public function changeShareTemplateStatus() { $result = 0; if ($_POST['status'] == 2 || $_POST['status'] == 3) { $id_array = explode(",", $_POST['ids']); foreach ($id_array as $id) { $sql = "select SKU from share_template where Id = " . $id; $result = mysql_query($sql, eBayListing::$database_connect); $row = mysql_fetch_assoc($result); $json_object = eBayListing::getInventoryServiceS("?action=getSkuStatus&data=" . $row['SKU']); //print_r($json_object); if ($json_object->status == "active" || $json_object->status == "out of stock") { $sql = "update share_template set status = " . $_POST['status'] . " where Id = " . $id; //echo $sql."\n"; $result = mysql_query($sql, eBayListing::$database_connect); } } } else { $sql = "update share_template set status = " . $_POST['status'] . " where Id in (" . $_POST['ids'] . ")"; //echo $sql."\n"; $result = mysql_query($sql, eBayListing::$database_connect); } echo $result; }
public function getSkuLowSoldPrice() { $sql = "select accountLocation from account where id = " . $this->account_id; $result = mysql_query($sql, eBayListing::$database_connect); $row = mysql_fetch_assoc($result); $accountLocation = $row['accountLocation']; $skuLowPrice = eBayListing::getSkuLowPriceS($_REQUEST['sku'], $_REQUEST['currency'], $accountLocation, $_REQUEST['site']); $shippingCost1 = $this->getShippingCost1ByTemplateName($_REQUEST['shippingTemplate']); $lowPrice = $skuLowPrice - $shippingCost1; if ($_REQUEST['type'] == "auction") { if ($_REQUEST['price'] > 0.01 && $_REQUEST['price'] < 0.99) { $lowPrice += 0.1; } elseif ($_REQUEST['price'] > 1 && $_REQUEST['price'] < 9.9) { $lowPrice += 0.25; } } echo $lowPrice; }