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
40ae5b42
Commit
40ae5b42
authored
Jul 10, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://gitlab.yidian-inc.com/bp/goods
into develop
parents
b380575f
daddd249
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
55 deletions
+60
-55
Goodstoes.php
application/modules/Cli/controllers/Goodstoes.php
+3
-3
Goodstoinit.php
application/modules/Cli/controllers/Goodstoinit.php
+54
-48
GoodsService.php
application/services/goods/GoodsService.php
+3
-4
No files found.
application/modules/Cli/controllers/Goods
ToE
s.php
→
application/modules/Cli/controllers/Goods
toe
s.php
View file @
40ae5b42
...
@@ -13,12 +13,12 @@ use App\Services\shop\ShopService;
...
@@ -13,12 +13,12 @@ use App\Services\shop\ShopService;
/**
/**
* 同步商品数据到es
* 同步商品数据到es
* php public/cli.php goods
ToE
s index
* php public/cli.php goods
toe
s index
* Class GoodsToEsController
* Class GoodsToEsController
*/
*/
class
Goods
ToE
sController
extends
Cli
class
Goods
toe
sController
extends
Cli
{
{
public
function
I
ndexAction
()
public
function
i
ndexAction
()
{
{
$this
->
initEsIndex
();
$this
->
initEsIndex
();
...
...
application/modules/Cli/controllers/Goods
ToI
nit.php
→
application/modules/Cli/controllers/Goods
toi
nit.php
View file @
40ae5b42
...
@@ -15,10 +15,10 @@ use \App\Models\shop\mysql\Shop;
...
@@ -15,10 +15,10 @@ use \App\Models\shop\mysql\Shop;
/**
/**
* 导入老商品数据
* 导入老商品数据
* php public/cli.php
GoodsToI
nit run
* php public/cli.php
goodstoi
nit run
* Class GoodsToInitController
* Class GoodsToInitController
*/
*/
class
Goods
ToI
nitController
extends
Cli
class
Goods
toi
nitController
extends
Cli
{
{
public
function
runAction
()
public
function
runAction
()
{
{
...
@@ -32,7 +32,7 @@ class GoodsToInitController extends Cli
...
@@ -32,7 +32,7 @@ class GoodsToInitController extends Cli
//处理 shop 数据
//处理 shop 数据
$this
->
dealShopData
(
$list
);
$this
->
dealShopData
(
$list
);
//处理商品数据
//处理商品数据
//
$this->dealGoodsData($list);
$this
->
dealGoodsData
(
$list
);
}
}
}
}
...
@@ -228,6 +228,8 @@ class GoodsToInitController extends Cli
...
@@ -228,6 +228,8 @@ class GoodsToInitController extends Cli
$originalPrice
=
$item
[
"price"
]
*
100
;
$originalPrice
=
$item
[
"price"
]
*
100
;
$price
=
$item
[
"rawPrice"
]
*
100
;
$price
=
$item
[
"rawPrice"
]
*
100
;
$goodsSpu
=
GoodsSpu
::
getRecord
([
"life_account_id"
=>
$lifeAccountId
,
"goods_name"
=>
$goodsName
]);
if
(
empty
(
$goodsSpu
))
{
$spuParams
=
[
$spuParams
=
[
"goods_spu_id"
=>
$goodsSpuId
,
"goods_spu_id"
=>
$goodsSpuId
,
"shop_id"
=>
$shopId
,
"shop_id"
=>
$shopId
,
...
@@ -244,7 +246,10 @@ class GoodsToInitController extends Cli
...
@@ -244,7 +246,10 @@ class GoodsToInitController extends Cli
"rule_refund"
=>
$ruleRefund
,
"rule_refund"
=>
$ruleRefund
,
];
];
GoodsSpu
::
save
(
$spuParams
);
GoodsSpu
::
save
(
$spuParams
);
}
$goodsSku
=
GoodsSku
::
getRecord
([
"life_account_id"
=>
$lifeAccountId
,
"goods_name"
=>
$goodsName
]);
if
(
empty
(
$goodsSku
))
{
$skuParams
=
[
$skuParams
=
[
"goods_sku_id"
=>
$goodsSkuId
,
"goods_sku_id"
=>
$goodsSkuId
,
"goods_spu_id"
=>
$goodsSpuId
,
"goods_spu_id"
=>
$goodsSpuId
,
...
@@ -273,8 +278,9 @@ class GoodsToInitController extends Cli
...
@@ -273,8 +278,9 @@ class GoodsToInitController extends Cli
"price"
=>
$price
,
"price"
=>
$price
,
"is_import"
=>
1
,
"is_import"
=>
1
,
];
];
GoodsSku
::
save
(
$skuParams
);
GoodsSku
::
save
(
$skuParams
);
}
$subShop
=
json_decode
(
$item
[
"shopJson"
],
true
);
$subShop
=
json_decode
(
$item
[
"shopJson"
],
true
);
if
(
!
empty
(
$subShop
))
{
if
(
!
empty
(
$subShop
))
{
...
...
application/services/goods/GoodsService.php
View file @
40ae5b42
...
@@ -214,7 +214,7 @@ class GoodsService
...
@@ -214,7 +214,7 @@ class GoodsService
"rule_end_time"
=>
empty
(
$skuData
[
"rule_end_time"
])
?
""
:
$skuData
[
"rule_end_time"
],
"rule_end_time"
=>
empty
(
$skuData
[
"rule_end_time"
])
?
""
:
$skuData
[
"rule_end_time"
],
"inventory_total"
=>
$skuData
[
"inventory"
],
"inventory_total"
=>
$skuData
[
"inventory"
],
"inventory_rest"
=>
$skuData
[
"inventory"
],
"inventory_rest"
=>
$skuData
[
"inventory"
],
"original_price"
=>
$skuData
[
"original_price"
]
*
100
,
"original_price"
=>
empty
(
$skuData
[
"original_price"
])
?
0
:
$skuData
[
"original_price"
]
*
100
,
"price"
=>
$skuData
[
"price"
]
*
100
,
"price"
=>
$skuData
[
"price"
]
*
100
,
];
];
if
(
!
empty
(
$skuData
[
"setmeal"
]))
{
if
(
!
empty
(
$skuData
[
"setmeal"
]))
{
...
@@ -937,12 +937,11 @@ class GoodsService
...
@@ -937,12 +937,11 @@ class GoodsService
}
}
if
(
!
empty
(
$lastId
))
{
if
(
!
empty
(
$lastId
))
{
$where
[
"goods_spu_id[
>
]"
]
=
$lastId
;
$where
[
"goods_spu_id[
<
]"
]
=
$lastId
;
}
}
$where
[
"life_account_id"
]
=
$lifeAccountId
;
$where
[
"life_account_id"
]
=
$lifeAccountId
;
$where
[
"inventory_rest[>]"
]
=
0
;
$where
[
"LIMIT"
]
=
$limit
;
$where
[
"LIMIT"
]
=
$limit
;
$where
[
"ORDER"
]
=
[
"
update_time
"
=>
"DESC"
];
$where
[
"ORDER"
]
=
[
"
goods_spu_id
"
=>
"DESC"
];
$list
=
GoodsSku
::
select
([
"goods_spu_id"
,
"goods_sku_id"
,
"goods_name"
,
"desc"
,
"desc_pic_url"
,
"total_amount_sold"
,
"inventory_rest"
,
"original_price"
,
$list
=
GoodsSku
::
select
([
"goods_spu_id"
,
"goods_sku_id"
,
"goods_name"
,
"desc"
,
"desc_pic_url"
,
"total_amount_sold"
,
"inventory_rest"
,
"original_price"
,
"price"
,
"audit_status"
,
"online_status"
],
$where
);
"price"
,
"audit_status"
,
"online_status"
],
$where
);
...
...
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