Authored by 郭成尧

店铺简介搞定

... ... @@ -30,7 +30,8 @@ class Yohobuy
const API_OLD = 'http://api2.open.yohobuy.com/';*/
// 测试环境 */
const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
// const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
const API_URL = 'http://devapi.yoho.cn:58078/'; // 'http://192.168.102.205:8080/gateway/'
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://test2.open.yohobuy.com/';
... ...
... ... @@ -12,7 +12,7 @@ namespace LibModels\Wap\Shop;
use Api\Yohobuy;
use Api\Sign;
class IntroData
class ShopData
{
/**
* 调取店铺简介数据
... ... @@ -20,11 +20,20 @@ class IntroData
* @param $shopId
* @return mixed
*/
public static function getShopIntro($shopId)
public static function getShopIntro($shopId = 0)
{
$param = Yohobuy::param();
$param['method'] = 'app.shops.getIntro';
$param['shops_id'] = $shopId;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
public static function getShopCategory($shopId = 0)
{
$param = Yohobuy::param();
$param['method'] = 'app.shop.getSortInfo';
$param['shop_id'] = $shopId;
$param['shops_id'] = $shopId;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
... ...
... ... @@ -8,7 +8,7 @@
*/
use Action\AbstractAction;
use LibModels\Wap\Shop\IntroData;
use LibModels\Wap\Shop\ShopData;
class IndexController extends AbstractAction
{
... ... @@ -39,7 +39,7 @@ class IndexController extends AbstractAction
$result = array();
// 假数据
$result = $this->getCategoryContent();
$result2 = IntroData::getShopIntro(356);
$result2 = ShopData::getShopIntro(356);
return $this->_view->display('category', array(
'content' => $result,
... ... @@ -53,15 +53,18 @@ class IndexController extends AbstractAction
*/
public function introAction()
{
$requestData = filter_input_array(INPUT_GET, array(
'shopId' => FILTER_DEFAULT,
));
if (empty($requestData['shopId'])) {
$this->go(SITE_MAIN);
}
$result = array();
// 假数据
$result = $this->getIntroContent();
// $requestData = filter_input_array(INPUT_GET, array(
// 'shopId' => FILTER_DEFAULT,
// ));
// if (empty($requestData['shopId'])) {
// $this->go(SITE_MAIN);
// }
$resource = ShopData::getShopIntro($requestData['shopId']);
if($resource['code'] === 200){
$result = $resource['data'];
}
return $this->_view->display('intro', array(
'content' => $result,
));
... ...