Authored by 周少峰

brand change and mobile encryption

... ... @@ -280,13 +280,26 @@ class UserData
public static function addressData($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.address.get';
$param['method'] = 'app.address.gethidden';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* @param $uid
* @return mixed
*/
public static function addressTextData($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.address.get';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取三级地址列表数据
*
... ...
... ... @@ -38,7 +38,7 @@ class SearchData
case 'test':
case 'developer':
default:
return 'http://192.168.10.64:8080/yohosearch/search.json';
return 'http://192.168.102.216:8087/yohosearch/search.json';
}
}
... ...
... ... @@ -154,8 +154,6 @@ class BrandModel
$brand = BrandData::getBrandsData($channel);
if (!empty($brand['data']['brands'])) {
$list = array();
$build = array();
foreach ($brand['data']['brands'] as $char => $value) {
$build = array();
foreach ($value as $row) {
... ... @@ -174,4 +172,54 @@ class BrandModel
return $result;
}
/**
* 品牌搜索历史
* @param int $uid
* @author sefon 2016-5-17 12:12:28
* @return array
*/
public static function branchSearchHistory($uid)
{
$result = array();
$list = BrandData::branchSearchHistory($uid);
do {
if (!isset($list['code']) || $list['code'] != 200 || !isset($list['data']) || empty($list['data'])) {
break;
}
foreach ($list['data'] as $key => $val) {
$result[] = array(
'url' => isset($val['brandDomain']) ? Helpers::url('', '', $val['brandDomain']) : 'test',
'id' => $val['id'],
'name' => $val['brandName']
);
}
} while(false);
return $result;
}
/**
* 热搜品牌
* @author sefon 2016-5-17 12:20:26
* @return array
*/
public static function branchSearchHot()
{
$result = array();
$hot = BrandData::hotSearchBrands();
do {
if (!isset($hot['code']) || $hot['code'] != 200 || !isset($hot['data']) || empty($hot['data'])) {
break;
}
foreach ($hot['data'] as $key => $val) {
$result[] = array(
'url' => isset($val['brandDomain']) ? Helpers::url('', '', $val['brandDomain']) : 'test',
'id' => $val['id'],
'name' => $val['brandName']
);
}
} while(false);
return $result;
}
}
... ...
... ... @@ -3,6 +3,7 @@
use Action\AbstractAction;
use Plugin\Helpers;
use LibModels\Wap\Category\BrandData;
use Category\BrandModel;
/**
* 品牌相关的控制器
... ... @@ -57,12 +58,18 @@ class BrandController extends AbstractAction
*/
public function searchAction()
{
$uid = $this->getUid();
$this->setTitle('品牌一览');
$this->setNavHeader('品牌一览', true, true);
$channel = Helpers::getChannelByCookie();
$data = Category\BrandModel::getBrandForSearch($channel);
$data = BrandModel::getBrandForSearch($channel);
//品牌搜索记录
if (!empty($uid)) {
$data['historySearch']['history'] = BrandModel::branchSearchHistory($uid);
}
//热搜品牌
$data['hot'] = BrandModel::branchSearchHot();
// 渲染模板
$this->_view->display('search', $data);
}
... ...