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
67aa169f
authored
Nov 06, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
判断问题
parent
5bc822a7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
app/Http/Controllers/Api/ExternalApiController.php
app/Http/Controllers/Api/ExternalApiController.php
View file @
67aa169f
...
@@ -9,6 +9,7 @@ use App\Http\Services\MessageService;
...
@@ -9,6 +9,7 @@ use App\Http\Services\MessageService;
use
App\Http\Services\SupplierApplyService
;
use
App\Http\Services\SupplierApplyService
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\SupplierService
;
use
App\Model\BigData\DataManageModel
;
use
App\Model\BigData\DataManageModel
;
use
App\Model\RedisModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
...
@@ -104,9 +105,14 @@ class ExternalApiController extends Controller
...
@@ -104,9 +105,14 @@ class ExternalApiController extends Controller
}
}
$cacheKey
=
"supplier:account_exist:"
.
$supplierId
;
$cacheKey
=
"supplier:account_exist:"
.
$supplierId
;
$exist
=
Cache
::
remember
(
$cacheKey
,
30
,
function
()
use
(
$supplierId
)
{
$redis
=
new
RedisModel
();
return
SupplierAccountModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'a_status'
,
1
)
->
exists
();
$exist
=
$redis
->
get
(
$cacheKey
);
});
if
(
$exist
)
{
$this
->
externalResponse
(
0
,
'ok'
,
'有芯链账号'
);
}
$exist
=
SupplierAccountModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'a_status'
,
1
)
->
exists
();
$redis
->
set
(
$cacheKey
,
$exist
);
$redis
->
expire
(
$cacheKey
,
30
);
if
(
$exist
)
{
if
(
$exist
)
{
$this
->
externalResponse
(
0
,
'ok'
,
'有芯链账号'
);
$this
->
externalResponse
(
0
,
'ok'
,
'有芯链账号'
);
}
}
...
...
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