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
c35d0fc1
Commit
c35d0fc1
authored
Jun 24, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:商品快照门店信息
parent
88983463
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
GoodsService.php
application/services/goods/GoodsService.php
+1
-2
ShopService.php
application/services/shop/ShopService.php
+21
-1
No files found.
application/services/goods/GoodsService.php
View file @
c35d0fc1
...
@@ -367,7 +367,6 @@ class GoodsService
...
@@ -367,7 +367,6 @@ class GoodsService
$operatorName
=
$params
[
"user_name"
];
$operatorName
=
$params
[
"user_name"
];
$goodsSpu
=
GoodsSpu
::
get
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
$goodsSpu
=
GoodsSpu
::
get
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
//todo::权限判断 后台管理员
//权限判断
//权限判断
if
(
!
empty
(
$params
[
"life_account_id"
])
&&
$goodsSpu
[
"life_account_id"
]
!=
$params
[
"life_account_id"
])
{
if
(
!
empty
(
$params
[
"life_account_id"
])
&&
$goodsSpu
[
"life_account_id"
]
!=
$params
[
"life_account_id"
])
{
throw
new
GoodsException
([
"cus"
=>
13
]);
throw
new
GoodsException
([
"cus"
=>
13
]);
...
@@ -426,7 +425,7 @@ class GoodsService
...
@@ -426,7 +425,7 @@ class GoodsService
*/
*/
private
static
function
addGoodsSnapshot
(
$skuInfo
)
private
static
function
addGoodsSnapshot
(
$skuInfo
)
{
{
$subShopList
=
ShopService
::
get
SubShopList
(
$skuInfo
[
"shop
_id"
]);
$subShopList
=
ShopService
::
get
RelationShop
(
$skuInfo
[
"goods_sku
_id"
]);
$skuInfo
[
"sub_shop"
]
=
json_encode
(
$subShopList
);
$skuInfo
[
"sub_shop"
]
=
json_encode
(
$subShopList
);
GoodsSnapshot
::
insertRecord
(
$skuInfo
);
GoodsSnapshot
::
insertRecord
(
$skuInfo
);
}
}
...
...
application/services/shop/ShopService.php
View file @
c35d0fc1
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
App\Services\shop
;
namespace
App\Services\shop
;
use
App\Models\goods\mysql\GoodsSkuSubShop
;
use
App\Models\shop\mysql\Shop
;
use
App\Models\shop\mysql\Shop
;
use
App\Models\shop\mysql\SubShop
;
use
App\Models\shop\mysql\SubShop
;
use
Api\PhpUtils\Validate\Validate
;
use
Api\PhpUtils\Validate\Validate
;
...
@@ -259,7 +260,7 @@ class ShopService
...
@@ -259,7 +260,7 @@ class ShopService
}
}
/**
/**
* 获取
制
定 shop_id 下的门店
* 获取
指
定 shop_id 下的门店
* @param $shopId
* @param $shopId
* @return \Api\PhpUtils\Mysql\MysqlBase
* @return \Api\PhpUtils\Mysql\MysqlBase
*/
*/
...
@@ -284,4 +285,23 @@ class ShopService
...
@@ -284,4 +285,23 @@ class ShopService
}
}
}
}
}
}
/**
* 获取商品关联的门店信息
* @param $goodsSkuId
* @return \Api\PhpUtils\Mysql\MysqlBase|array
*/
public
static
function
getRelationShop
(
$goodsSkuId
)
{
$subShopIds
=
GoodsSkuSubShop
::
select
(
"sub_shop_id"
,
[
"goods_sku_id"
=>
$goodsSkuId
]);
$subShopList
=
[];
if
(
!
empty
(
$subShopIds
))
{
$subShopIdList
=
[];
foreach
(
$subShopIds
as
$subShopId
)
{
$subShopIdList
[]
=
$subShopId
;
}
$subShopList
=
SubShop
::
select
(
"*"
,
[
"sub_shop_id"
=>
$subShopIdList
]);
}
return
$subShopList
;
}
}
}
\ 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