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
1d47974b
Commit
1d47974b
authored
Jun 21, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:op后台展示商品详情
parent
7b5d8f05
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
3 deletions
+40
-3
GoodsOperationRecord.php
application/models/goods/mysql/GoodsOperationRecord.php
+13
-0
GoodsService.php
application/services/goods/GoodsService.php
+17
-3
ShopService.php
application/services/shop/ShopService.php
+10
-0
No files found.
application/models/goods/mysql/GoodsOperationRecord.php
View file @
1d47974b
...
@@ -18,9 +18,22 @@ class GoodsOperationRecord extends MysqlBase
...
@@ -18,9 +18,22 @@ class GoodsOperationRecord extends MysqlBase
const
STATUS_PASS
=
1
;
//审核通过
const
STATUS_PASS
=
1
;
//审核通过
const
STATUS_REJECT
=
2
;
//审核驳回
const
STATUS_REJECT
=
2
;
//审核驳回
public
static
$statusDesc
=
[
self
::
STATUS_AUDIT
=>
"待审核"
,
self
::
STATUS_PASS
=>
"审核通过"
,
self
::
STATUS_REJECT
=>
"审核驳回"
,
];
const
ONLINE_STATUS_UN_ONLINE
=
0
;
//未上架
const
ONLINE_STATUS_ONLINE
=
1
;
//已上架
const
ONLINE_STATUS_ONLINE
=
1
;
//已上架
const
ONLINE_STATUS_OFFLINE
=
2
;
//已下架
const
ONLINE_STATUS_OFFLINE
=
2
;
//已下架
public
static
$onlineStatusDesc
=
[
self
::
ONLINE_STATUS_UN_ONLINE
=>
"未上架"
,
self
::
ONLINE_STATUS_ONLINE
=>
"已上架"
,
self
::
ONLINE_STATUS_OFFLINE
=>
"已下架"
,
];
public
static
function
getRecord
(
$where
,
$colums
=
[])
public
static
function
getRecord
(
$where
,
$colums
=
[])
{
{
if
(
empty
(
$colums
))
{
if
(
empty
(
$colums
))
{
...
...
application/services/goods/GoodsService.php
View file @
1d47974b
...
@@ -13,6 +13,7 @@ use App\Models\goods\mysql\GoodsOperationRecord;
...
@@ -13,6 +13,7 @@ use App\Models\goods\mysql\GoodsOperationRecord;
use
App\Models\goods\mysql\GoodsSku
;
use
App\Models\goods\mysql\GoodsSku
;
use
App\Models\goods\mysql\GoodsSpu
;
use
App\Models\goods\mysql\GoodsSpu
;
use
App\Models\goods\mysql\Shop
;
use
App\Models\goods\mysql\Shop
;
use
App\Services\shop\ShopService
;
class
GoodsService
class
GoodsService
{
{
...
@@ -561,14 +562,27 @@ class GoodsService
...
@@ -561,14 +562,27 @@ class GoodsService
//当前这里一个spu对应一个sku
//当前这里一个spu对应一个sku
if
(
!
empty
(
$goodsSkuList
))
{
if
(
!
empty
(
$goodsSkuList
))
{
foreach
(
$goodsSkuList
as
$key
=>
$sku
)
{
foreach
(
$goodsSkuList
as
$key
=>
$sku
)
{
//todo::图片处理
,门店,套餐,生活号信息
//todo::图片处理
$data
[
"goods_info"
]
=
$sku
;
$data
[
"goods_info"
]
=
$sku
;
$subShopList
=
ShopService
::
getSubShopList
(
$sku
[
"shop_id"
]);
if
(
!
empty
(
$subShopList
))
{
foreach
(
$subShopList
as
$key
=>
$subShop
)
{
$data
[
"goods_info"
][
"sub_shop"
][
$key
]
=
$subShop
;
}
}
}
}
}
}
$recordList
=
GoodsOperationRecord
::
select
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
$recordList
=
GoodsOperationRecord
::
select
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
if
(
!
empty
(
$recordList
))
{
if
(
!
empty
(
$recordList
))
{
//todo::处理展示内容
foreach
(
$recordList
as
$key
=>
$record
)
{
$data
[
"record_list"
]
=
$recordList
;
$data
[
"record_list"
][
$key
][
"status"
]
=
$record
[
"goods_status"
];
$data
[
"record_list"
][
$key
][
"status_desc"
]
=
GoodsOperationRecord
::
$statusDesc
[
$record
[
"goods_status"
]];
$data
[
"record_list"
][
$key
][
"online_status"
]
=
$record
[
"online_status"
];
$data
[
"record_list"
][
$key
][
"online_status_desc"
]
=
GoodsOperationRecord
::
$onlineStatusDesc
[
$record
[
"online_status"
]];
$data
[
"record_list"
][
$key
][
"create_time"
]
=
$record
[
"create_time"
];
$data
[
"record_list"
][
$key
][
"operator_name"
]
=
$record
[
"operator_name"
];
$data
[
"record_list"
][
$key
][
"note"
]
=
$record
[
"note"
];
}
}
}
return
$data
;
return
$data
;
}
}
...
...
application/services/shop/ShopService.php
View file @
1d47974b
...
@@ -248,4 +248,14 @@ class ShopService
...
@@ -248,4 +248,14 @@ class ShopService
"count"
=>
$count
]],
[]);
"count"
=>
$count
]],
[]);
return
$res
[
'id_snow'
][
$type
]
??
[];
return
$res
[
'id_snow'
][
$type
]
??
[];
}
}
/**
* 获取制定 shop_id 下的门店
* @param $shopId
* @return \Api\PhpUtils\Mysql\MysqlBase
*/
public
static
function
getSubShopList
(
$shopId
)
{
return
SubShop
::
select
(
"*"
,
[
"shop_id"
=>
$shopId
]);
}
}
}
\ 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