Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b2fa6ac8
authored
Jun 12, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp
parent
b7f22b61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
14 deletions
app/Http/Controllers/ApiController.php
app/Http/Controllers/ApiController.php
View file @
b2fa6ac8
...
...
@@ -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
);
}
// 绑定品牌
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment