Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
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
468e5b92
authored
Nov 04, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
加上缓存
parent
6e931880
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
app/Http/Controllers/Api/ExternalApiController.php
app/Http/Controllers/Api/ExternalApiController.php
View file @
468e5b92
...
...
@@ -12,6 +12,7 @@ use App\Model\BigData\DataManageModel;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Cache
;
use
Illuminate\Support\Facades\Validator
;
...
...
@@ -19,9 +20,7 @@ use Illuminate\Support\Facades\Validator;
class
ExternalApiController
extends
Controller
{
public
function
__construct
()
{
}
public
function
__construct
()
{}
public
function
searchSupplier
(
Request
$request
)
{
...
...
@@ -103,8 +102,12 @@ class ExternalApiController extends Controller
if
(
empty
(
$supplierId
))
{
$this
->
externalResponse
(
-
1
,
'供应商ID不能为空'
);
}
$supplierAccount
=
SupplierAccountModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'a_status'
,
1
)
->
first
();
if
(
$supplierAccount
)
{
$cacheKey
=
"supplier:account_exist:"
.
$supplierId
;
$exist
=
Cache
::
remember
(
$cacheKey
,
300
,
function
()
use
(
$supplierId
)
{
return
SupplierAccountModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'a_status'
,
1
)
->
exists
();
});
if
(
$exist
)
{
$this
->
externalResponse
(
0
,
'ok'
,
'有芯链账号'
);
}
$this
->
externalResponse
(
-
1
,
'没有找到芯链账号'
);
...
...
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