Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
d4137182
Commit
d4137182
authored
Jun 16, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:op good list
parent
2c071c87
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
2 deletions
+68
-2
GoodsAddValidate.php
application/library/Validate/GoodsAddValidate.php
+2
-0
GoodsSku.php
application/models/goods/mysql/GoodsSku.php
+5
-0
Goods.php
application/modules/Goods/controllers/Goods.php
+5
-2
GoodsService.php
application/services/goods/GoodsService.php
+56
-0
No files found.
application/library/Validate/GoodsAddValidate.php
View file @
d4137182
...
...
@@ -22,6 +22,7 @@ class GoodsAddValidate extends BaseValidate
'inventory_total'
=>
'require'
,
'life_account_id'
=>
'require'
,
'merchant_id'
=>
'require'
,
'u_id'
=>
'require'
,
];
protected
$message
=
[
...
...
@@ -35,5 +36,6 @@ class GoodsAddValidate extends BaseValidate
'inventory_total'
=>
'请填写库存'
,
'life_account_id'
=>
'life_account_id 不能为空'
,
'merchant_id'
=>
'merchant_id 不能为空'
,
'u_id'
=>
'u_id 不能为空'
,
];
}
\ No newline at end of file
application/models/goods/mysql/GoodsSku.php
View file @
d4137182
...
...
@@ -49,4 +49,9 @@ class GoodsSku extends MysqlBase
{
return
self
::
delete
(
$where
);
}
public
static
function
getCount
(
$where
)
{
return
self
::
count
(
$where
);
}
}
\ No newline at end of file
application/modules/Goods/controllers/Goods.php
View file @
d4137182
...
...
@@ -55,7 +55,7 @@ class GoodsController extends Base
$params
=
$this
->
params
;
$data
=
GoodsService
::
getGoodsSpuInfo
(
$params
);
$this
->
success
([
"data"
=>
$data
]);
$this
->
success
([
"data"
=>
$data
]);
}
/**
...
...
@@ -67,7 +67,7 @@ class GoodsController extends Base
$params
=
$this
->
params
;
$data
=
GoodsService
::
getGoodsSkuInfo
(
$params
);
$this
->
success
([
"data"
=>
$data
]);
$this
->
success
([
"data"
=>
$data
]);
}
/**
...
...
@@ -113,7 +113,10 @@ class GoodsController extends Base
*/
public
function
goods_list_opAction
()
{
$params
=
$this
->
params
;
$data
=
GoodsService
::
getOpGoodsSpuList
(
$params
);
$this
->
success
([
"data"
=>
$data
]);
}
/**
...
...
application/services/goods/GoodsService.php
View file @
d4137182
...
...
@@ -91,6 +91,7 @@ class GoodsService
"goods_spu_id"
=>
$spuId
,
"shop_id"
=>
$shopId
,
"life_account_id"
=>
$spuData
[
"life_account_id"
],
"u_id"
=>
$spuData
[
"u_id"
],
"name"
=>
$spuData
[
"name"
],
"url"
=>
$spuData
[
"url"
],
"desc"
=>
$spuData
[
"desc"
],
...
...
@@ -472,4 +473,59 @@ class GoodsService
$data
[
"goods_info"
]
=
$goodsSku
;
return
$data
;
}
/**
* op后台商品列表
* @param array $params
* @return array
*/
public
static
function
getOpGoodsSpuList
(
$params
=
[])
{
$params
[
'page'
]
=
!
empty
(
$params
[
'page'
])
?
$params
[
'page'
]
:
1
;
$limit
=
!
empty
(
$params
[
'page_size'
])
?
$params
[
'page_size'
]
:
20
;
$page
=
(
$params
[
'page'
]
-
1
)
*
$limit
;
$where
=
$data
=
[];
if
(
!
empty
(
$params
[
"goods_spu_id"
]))
{
$where
[
"goods_spu_id"
]
=
$params
[
"goods_spu_id"
];
}
if
(
!
empty
(
$params
[
"name"
]))
{
$where
[
"name"
]
=
$params
[
"name"
];
}
if
(
!
empty
(
$params
[
"category_1_id"
]))
{
$where
[
"category_1_id"
]
=
$params
[
"category_1_id"
];
}
if
(
!
empty
(
$params
[
"category_2_id"
]))
{
$where
[
"category_2_id"
]
=
$params
[
"category_2_id"
];
}
if
(
!
empty
(
$params
[
"life_account_id"
]))
{
$where
[
"life_account_id"
]
=
$params
[
"life_account_id"
];
}
if
(
!
empty
(
$params
[
"status"
]))
{
$where
[
"status"
]
=
$params
[
"status"
];
}
if
(
!
empty
(
$params
[
"online_status"
]))
{
$where
[
"online_status"
]
=
$params
[
"online_status"
];
}
$count
=
GoodsSku
::
getCount
(
$where
);
$where
[
'LIMIT'
]
=
[
$page
,
$limit
];
$where
[
'ORDER'
]
=
[
"create_time"
=>
"DESC"
];
$list
=
GoodsSku
::
select
([
"goods_spu_id"
,
"goods_sku_id"
,
"name"
,
"category_1_id"
,
"category_2_id"
,
"life_account_id"
,
"u_id"
,
"update_time"
,
"create_time"
,
"status"
,
"online_status"
],
$where
);
return
[
"list"
=>
$list
,
"count"
=>
$count
];
}
public
static
function
getBGoodsSpuList
(
$params
=
[])
{
}
public
static
function
getCGoodsSpuList
(
$params
=
[])
{
}
}
\ 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