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
3fb1e7bf
Commit
3fb1e7bf
authored
Jul 28, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:脚本调整,生成skuid调整
parent
1c5fbbf3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
25 deletions
+5
-25
Goodstoinit.php
application/modules/Cli/controllers/Goodstoinit.php
+1
-23
GoodsSkuId.php
vendor/api/php_utils/src/Common/GoodsSkuId.php
+4
-2
No files found.
application/modules/Cli/controllers/Goodstoinit.php
View file @
3fb1e7bf
...
...
@@ -30,7 +30,7 @@ class GoodstoinitController extends Cli
echo
$i
.
"
\n
"
;
$list
=
$this
->
getDataList
(
$i
,
$pageSize
);
//处理 shop 数据
$this
->
dealShopData
(
$list
);
//
$this->dealShopData($list);
//处理商品数据
$this
->
dealGoodsData
(
$list
);
}
...
...
@@ -244,15 +244,6 @@ class GoodstoinitController extends Cli
"rule_refund"
=>
$ruleRefund
,
];
GoodsSpu
::
save
(
$spuParams
);
}
else
{
$spuParams
=
[
"desc_pic_url"
=>
$descPicUrl
,
"desc"
=>
$desc
,
"rule_limit"
=>
$ruleLimit
,
"rule_desc"
=>
$ruleDesc
,
"rule_refund"
=>
$ruleRefund
,
];
GoodsSpu
::
save
(
$spuParams
,
[
"goods_spu_id"
=>
$goodsSpu
[
"goods_spu_id"
]]);
}
$goodsSku
=
GoodsSku
::
getRecord
([
"life_account_id"
=>
$lifeAccountId
,
"goods_name"
=>
$goodsName
]);
...
...
@@ -288,23 +279,10 @@ class GoodstoinitController extends Cli
GoodsSku
::
save
(
$skuParams
);
}
else
{
$skuParams
=
[
"goods_name"
=>
$goodsName
,
"desc_pic_url"
=>
$descPicUrl
,
"desc"
=>
$desc
,
"introduce"
=>
$introduce
,
"introduce_pic_url"
=>
$introducePicUrl
,
"rule_limit"
=>
$ruleLimit
,
"rule_desc"
=>
$ruleDesc
,
"rule_refund"
=>
$ruleRefund
,
"rule_date_type"
=>
$ruleDateType
,
"rule_start_time"
=>
$ruleStartTime
,
"rule_end_time"
=>
$ruleEndTime
,
"inventory_total"
=>
$inventoryTotal
,
"inventory_rest"
=>
$inventoryRest
,
"total_amount_order"
=>
$totalAmountOrder
,
"total_amount_sold"
=>
$totalAmountOrder
,
"original_price"
=>
$originalPrice
,
"price"
=>
$price
,
];
GoodsSku
::
save
(
$skuParams
,
[
"goods_sku_id"
=>
$goodsSku
[
"goods_sku_id"
]]);
}
...
...
vendor/api/php_utils/src/Common/GoodsSkuId.php
View file @
3fb1e7bf
...
...
@@ -11,14 +11,16 @@ class GoodsSkuId
* category_1_id 一级分类的id,两位,不足两位在十位补零
* category_2_id 二级分类的id,两位,不足三位在百位补零
* spu 商品类型,1虚拟商品,2实体商品
* goodsType 1、(默认)第三方商品 2、自营商品
*
* @param $id
* @param $category1Id
* @param $category2Id
* @param $spuType
* @param $goodsType
* @return string
*/
public
static
function
generateGoodSkuId
(
$id
,
$category1Id
,
$category2Id
,
$spuType
)
public
static
function
generateGoodSkuId
(
$id
,
$category1Id
,
$category2Id
,
$spuType
,
$goodsType
=
1
)
{
if
(
strlen
(
$category1Id
)
==
1
)
{
$category1Id
=
"0"
.
$category1Id
;
...
...
@@ -26,7 +28,7 @@ class GoodsSkuId
if
(
strlen
(
$category2Id
)
==
2
)
{
$category2Id
=
"0"
.
$category2Id
;
}
$idStr
=
$id
.
$category1Id
.
$category2Id
.
$spuType
;
$idStr
=
$id
.
$category1Id
.
$category2Id
.
$spuType
.
$goodsType
;
//转62进制
$tmp
=
BaseConvert
::
decToOther
(
$idStr
);
...
...
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