public function add() { if ($this->isAjax()) { if (C('TOKEN_ON') && !checkFormToken($_REQUEST)) { die('hack attemp.'); } $cid = intval($_REQUEST['id']); $name = $_REQUEST['name']; $data = array('cid' => $cid, 'name' => $name); if (M('tao_shop_category')->add($data)) { //清除缓存 $params = null; B('TaoShopCategory', $params); $this->ajaxReturn('', buildFormToken(), 1); } else { $this->ajaxReturn('', buildFormToken(), 0); } } import('@.Com.taobao.Taobao'); $taobaoObj = Taobao::getInstance(); $tao_shop_categorys = $taobaoObj->ShopCatesList(); $this->assign('tao_shop_categorys', $tao_shop_categorys); $this->assign('ur_href', '淘宝店铺分类管理 > 添加分类'); $this->assign('_hash_', buildFormToken()); $this->display(); }
function userInfo() { import('@.Com.taobao.Taobao'); $taobaoObj = Taobao::getInstance(TAOBAO_LOGIN_APPKEY, TAOBAO_LOGIN_APPSECRET); $user = $taobaoObj->getUserInfo(null, $_SESSION['taobao']["access_token"]); return $user; }
public static function _tao_shop_recommend_items($seller_id, $limit = 10) { import('@.Com.taobao.Taobao'); $taobaoObj = Taobao::getInstance(); $result = $taobaoObj->getShoprecommendItems($seller_id, $limit); return $result; }
public function add_step3() { if ($this->isAjax()) { if (C('TOKEN_ON') && !checkFormToken($_REQUEST)) { die('hack attemp.'); } if (!$_REQUEST['nick']) { exit; } $nick = $_REQUEST['nick']; if (M('tao_shop')->field('id')->where("nick='{$nick}'")->find()) { $this->ajaxReturn('', buildFormToken(), 1); } else { import('@.Com.taobao.Taobao'); $taobaoObj = Taobao::getInstance(); $data = $taobaoObj->createShopByNick($nick); if (empty($data)) { $this->ajaxReturn('', buildFormToken(), 0); } $taoshopModel = D('TaoShop'); $data['is_active'] = 1; if ($taoshopModel->_add($data)) { $this->ajaxReturn('', buildFormToken(), 1); } else { $this->ajaxReturn('', buildFormToken(), 0); } } } }