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
5e7d3799
Commit
5e7d3799
authored
Aug 04, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:增加拼单商品
parent
8a200f38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
Goods.php
application/modules/Goods/controllers/Goods.php
+9
-4
MarketingPindanGoodsService.php
application/services/goods/MarketingPindanGoodsService.php
+21
-1
No files found.
application/modules/Goods/controllers/Goods.php
View file @
5e7d3799
...
...
@@ -16,6 +16,7 @@ use \Validate\PaySuccessGoodsCallbackValidate;
use
\Validate\GoodsInitShopValidate
;
use
\App\Services\goods\ElasticGoodService
;
use
\App\Services\goods\MarketingPindanGoodsService
;
use
\App\Models\marketing\mysql\Marketing
;
class
GoodsController
extends
Base
...
...
@@ -46,14 +47,18 @@ class GoodsController extends Base
public
function
addAction
()
{
$params
=
$this
->
params
;
if
(
!
empty
(
$params
[
"marketing_type"
])
&&
$params
[
"marketing_type"
]
==
\App\Models\marketing\mysql\
Marketing
::
MARKETING_TYPE_PINDAN
)
{
if
(
!
empty
(
$params
[
"marketing_type"
])
&&
$params
[
"marketing_type"
]
==
Marketing
::
MARKETING_TYPE_PINDAN
)
{
}
else
{
(
new
GoodsAddValidate
())
->
validate
();
}
GoodsService
::
addGoods
(
$params
);
$this
->
success
();
$res
=
GoodsService
::
addGoods
(
$params
);
if
(
!
empty
(
$params
[
"marketing_type"
])
&&
$params
[
"marketing_type"
]
==
Marketing
::
MARKETING_TYPE_PINDAN
)
{
$this
->
success
([
"result"
=>
$res
]);
}
else
{
$this
->
success
();
}
}
/**
...
...
@@ -62,7 +67,7 @@ class GoodsController extends Base
public
function
editAction
()
{
$params
=
$this
->
params
;
if
(
!
empty
(
$params
[
"marketing_type"
])
&&
$params
[
"marketing_type"
]
==
\App\Models\marketing\mysql\
Marketing
::
MARKETING_TYPE_PINDAN
)
{
if
(
!
empty
(
$params
[
"marketing_type"
])
&&
$params
[
"marketing_type"
]
==
Marketing
::
MARKETING_TYPE_PINDAN
)
{
}
else
{
(
new
GoodsEditValidate
())
->
validate
();
...
...
application/services/goods/MarketingPindanGoodsService.php
View file @
5e7d3799
...
...
@@ -75,7 +75,21 @@ class MarketingPindanGoodsService
GoodsSpu
::
rollback
();
throw
new
GoodsException
([
"cus"
=>
0
]);
}
return
$skuId
;
$sku
=
PindanGoodsSku
::
getRecordMaster
([
"goods_sku_id"
=>
$skuId
]);
$data
=
[];
if
(
!
empty
(
$sku
[
0
]))
{
$sku
=
$sku
[
0
];
$data
[
"goods_info"
]
=
$sku
;
$data
[
"goods_info"
][
"original_price"
]
=
empty
(
$sku
[
"original_price"
])
?
''
:
(
string
)(
$sku
[
"original_price"
]
/
100
);
$data
[
"goods_info"
][
"price"
]
=
$sku
[
"price"
]
/
100
;
$data
[
"goods_info"
][
"desc_pic_url_list"
]
=
[];
if
(
!
empty
(
$sku
[
"desc_pic_url"
]))
{
$ksyun
=
GoodsService
::
getUrlList
(
$sku
[
"desc_pic_url"
]);
$data
[
"goods_info"
][
"desc_pic_url_list"
]
=
$ksyun
;
}
}
return
$data
;
}
/**
...
...
@@ -384,6 +398,12 @@ class MarketingPindanGoodsService
return
[
"list"
=>
$list
,
"count"
=>
$count
];
}
/**
* 获取拼单商品详情
* @param $params
* @return array
* @throws GoodsException
*/
public
static
function
pindanGoodsInfo
(
$params
)
{
$data
=
[];
...
...
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