Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
LC_server_goods
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
2f26e091
authored
Dec 05, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加品牌信息接口
parent
33684742
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
7 deletions
.env
app/Http/Controllers/BrandController.php
app/Model/SelfBrandModel.php
routes/web.php
storage/framework/cache/1f/4a/1f4a184b1120e82e739c7cccc1e2f0951e15ce36
storage/framework/cache/87/17/871790787108f96eecddc81a8de06f5ed47e4aeb
storage/framework/cache/d1/2d/d12d8e34bf81a8375aac47b56d2e393181114c81
.env
View file @
2f26e091
...
...
@@ -11,7 +11,7 @@ SYSTEM_NAME=商品信息处理服务(开发环境)
//laravels监听IP和端口
LARAVELS_LISTEN_IP=0.0.0.0
LARAVELS_LISTEN_PORT=6
0
002
LARAVELS_LISTEN_PORT=6
2
002
//基石自营商品主库
DB_Self_HOST=192.168.1.234
...
...
app/Http/Controllers/BrandController.php
View file @
2f26e091
...
...
@@ -8,6 +8,7 @@ use Illuminate\Http\Request;
class
BrandController
extends
Controller
{
//获取品牌列表
public
function
index
(
Request
$request
,
SelfBrandModel
$model
)
{
$map
=
$request
->
only
([
'brand_area'
]);
...
...
@@ -15,4 +16,13 @@ class BrandController extends Controller
return
$this
->
Export
(
0
,
'ok'
,
[
'data'
=>
$list
]);
}
//获取单个品牌信息
public
function
info
(
Request
$request
,
SelfBrandModel
$model
)
{
$brandId
=
$request
->
get
(
'brand_id'
);
$info
=
$model
->
getBrand
(
$brandId
);
return
$this
->
Export
(
0
,
'ok'
,
[
'data'
=>
$info
]);
}
}
\ No newline at end of file
app/Model/SelfBrandModel.php
View file @
2f26e091
...
...
@@ -56,6 +56,23 @@ class SelfBrandModel extends Model
return
$Find
;
}
//获取品牌信息
public
function
getBrand
(
$brandId
)
{
$expireMinutes
=
5
;
return
Cache
::
remember
(
'brandList_'
.
$brandId
,
$expireMinutes
,
function
()
use
(
$brandId
)
{
//没有再去数据库里面取
$field
=
[
'brand_id'
,
'brand_name'
,
'brand_logo'
,
'brand_desc'
,
'brand_brief'
,
'brand_area'
];
$brand
=
$this
->
select
(
$field
)
->
where
(
'brand_id'
,
$brandId
)
->
first
();
if
(
!
empty
(
$brand
))
{
return
$brand
->
toArray
();
}
return
null
;
});
}
//品牌列表
public
function
getBrandList
(
$map
=
[])
{
...
...
@@ -84,12 +101,7 @@ class SelfBrandModel extends Model
//没有就去数据库里面取
if
(
!
$brandList
)
{
return
Cache
::
remember
(
'brandList_'
.
json_encode
(
$map
),
$expireMinutes
,
function
()
use
(
$map
)
{
$field
=
[
'brand_id'
,
'brand_name'
,
'brand_logo'
,
'brand_area'
,
];
$field
=
[
'brand_id'
,
'brand_name'
,
'brand_logo'
,
'brand_area'
];
$query
=
$this
->
select
(
$field
)
->
where
(
'status'
,
1
);
if
(
!
empty
(
$map
[
'brand_area'
]))
{
...
...
routes/web.php
View file @
2f26e091
...
...
@@ -30,4 +30,5 @@ $router->post('/class/list', 'ClassController@index');
//品牌
$router
->
post
(
'/brand/list'
,
'BrandController@index'
);
$router
->
post
(
'/brand/info'
,
'BrandController@info'
);
storage/framework/cache/1f/4a/1f4a184b1120e82e739c7cccc1e2f0951e15ce36
0 → 100644
View file @
2f26e091
1575532911a:6:{s:8:"brand_id";i:5290;s:10:"brand_name";s:20:"CJIANG(长江微电)";s:10:"brand_logo";s:0:"";s:10:"brand_desc";s:0:"";s:11:"brand_brief";s:0:"";s:10:"brand_area";i:4;}
\ No newline at end of file
storage/framework/cache/87/17/871790787108f96eecddc81a8de06f5ed47e4aeb
0 → 100644
View file @
2f26e091
1575532918a:6:{s:8:"brand_id";i:5291;s:10:"brand_name";s:15:"STARSEA(星海)";s:10:"brand_logo";s:0:"";s:10:"brand_desc";s:0:"";s:11:"brand_brief";s:0:"";s:10:"brand_area";i:4;}
\ No newline at end of file
storage/framework/cache/d1/2d/d12d8e34bf81a8375aac47b56d2e393181114c81
0 → 100644
View file @
2f26e091
1575532933a:6:{s:8:"brand_id";i:70;s:10:"brand_name";s:5:"ACARD";s:10:"brand_logo";s:79:"http://img.ichunt.com/images/ichunt/uploadfiles/20150929/201509291802573384.jpg";s:10:"brand_desc";s:1272:"<p><span style="font-size: 14px; font-family: arial, helvetica, sans-serif; color: rgb(89, 89, 89);">ACARD Technology Corp.(信亿科技)成立于1996年,为提供储存设备解决方案之世界级专业领导厂商。创业初期即专注在研发IC晶片,是台湾第一家拥有SCSI晶片设计能力的公司,在ACARD秉持诚信、高品质的经营理念下公司持续稳定的成长,更在2004年12月6日正式挂牌上柜营运(代号3126),而为了使经营版图更为扩张以及让台湾以外的客户能放心与信亿合作,ACARD在2008年正式取得邓白氏认証的核准资格。</span></p><p><span style="font-size: 14px; font-family: arial, helvetica, sans-serif; color: rgb(89, 89, 89);">ACARD以ACARD作为品牌行销,在IDE & SCSI享有高度评价,也是全球率先推出PCI Ultra ATA-100/133 IDE RAID Adapter for PCI PowerMac以及PCI Ultra ATA-133 IDE RAID Adapter for PC之厂商。目前所提供产品包括积体电路、SCSI/IDE/SCSI-to-IDE/ SATA 储存控制器、磁碟储存控制器及系统、储存应用软体等。与ACARD合作的客户包含了IBM、HP、Nokia...等知名企业,产品供应全球涵括PC、Macintosh和Unix工作站的使用者,并可提供OEM/ODM服务。</span></p><p><br/></p>";s:11:"brand_brief";s:228:"ACARD Technology Corp.(信亿科技)成立于1996年,为提供储存设备解决方案之世界级专业领导厂商。创业初期即专注在研发IC晶片,是台湾第一家拥有SCSI晶片设计能力的公司,在ACA";s:10:"brand_area";i:3;}
\ No newline at end of file
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