Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
media-resource
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨昕
media-resource
Commits
2c0c651a
Commit
2c0c651a
authored
Mar 25, 2021
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化获取店铺列表
parent
ac87dbf0
Pipeline
#14026
passed with stages
in 4 minutes 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
MediaCategoryModel.php
app/Model/MediaCategoryModel.php
+8
-9
No files found.
app/Model/MediaCategoryModel.php
View file @
2c0c651a
...
...
@@ -31,17 +31,22 @@ class MediaCategoryModel extends Eloquent
/**
* 获取用户业务线及对应业务线的权限
*/
$catgList
=
MediaCategoryModel
::
where
(
'status'
,
0
)
->
limit
(
20
)
->
get
()
->
toArray
();
$appids
=
array_column
(
$catgList
,
"media_category_id"
);
#需要传一个默认的appid,否则接口会报参数缺失错误
$url
=
getRbac
(
$request
,
'api/open/getPlatform'
,
'ec8747abc5dbe8288e64f327a76ac517'
);
$result
=
http_request_code
(
$url
,
array
(
"Content-Type: application/json"
),
'POST'
,
json_encode
(
array
()
)
json_encode
(
$appids
)
);
LogModel
::
addlog
([
'获取商店列表'
=>
json_decode
(
$result
)]);
$catgs
=
json_decode
(
$result
,
true
);
if
(
!
isset
(
$catgs
[
'data'
])){
...
...
@@ -49,13 +54,8 @@ class MediaCategoryModel extends Eloquent
throw
new
\Exception
(
"获取商店列表失败"
);
}
$catgList
=
MediaCategoryModel
::
get
()
->
toArray
();
$appids
=
array_column
(
$catgs
[
'data'
],
"appid"
);
$tmp
=
[];
foreach
(
$catgList
as
$catg
){
...
...
@@ -64,7 +64,6 @@ class MediaCategoryModel extends Eloquent
}
}
}
catch
(
\Exception
$exception
){
throw
new
DatabaseException
(
$exception
->
getMessage
());
}
...
...
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