Commit b2fa6ac8 by 朱继来

temp

parent b7f22b61
Showing with 27 additions and 14 deletions
......@@ -289,32 +289,45 @@ class ApiController extends Controller
// 获取品牌库列表
public function getStandardBrandList($request)
{
$standard_brand_name = $request->input('standard_brand_name', '');
// 搜索指定品牌
if ($standard_brand_name) {
$res = $this->apiStandardBrandList($standard_brand_name);
$this->ExportLayui(0, '', $res['data'], count($res['data']));
}
$s_key = Config('config.s_standard_brand');
$data = Redis::get($s_key);
// 无缓存情况下
if (!$data) {
$url = Config('config.footstone_url').'/AuthApi/get_scm_brand_list';
$key = Config('config.auth_key');
$res = $this->apiStandardBrandList();
$data = json_encode($res['data']);
$standard_brand_name = $request->input('standard_brand_name', '');
$standard_brand_name && $map['erp_brand_name'] = $standard_brand_name;
$map['time'] = time();
$map['AuthSign'] = MD5(MD5(http_build_query($map)) . $key);
$expire = Config('config.s_standard_brand_expire');
Redis::setex($s_key, $expire, $data);
}
$data['data'] = $map;
$data = json_decode($data, true);
$result = json_decode(curlApi($url, $data, 'post'), true);
$this->ExportLayui(0, '', $data, count($data));
}
$expire = Config('config.s_standard_brand_expire');
Redis::set($s_key, json_encode($result['data']), $expire);
public function apiStandardBrandList($standard_brand_name='')
{
$url = Config('config.footstone_url').'/AuthApi/get_scm_brand_list';
$key = Config('config.auth_key');
}
$standard_brand_name && $map['erp_brand_name'] = $standard_brand_name;
$map['time'] = time();
$map['AuthSign'] = MD5(MD5(http_build_query($map)) . $key);
$data['data'] = $map;
$this->ExportLayui($result['errcode'], $result['errmsg'], $result['data'], count($result['data']));
return json_decode(curlApi($url, $data, 'post'), true);
}
// 绑定品牌
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment