Commit 5eb6359e authored by luhongguang's avatar luhongguang

update:拼单商品编辑

parent f2728bcd
......@@ -44,9 +44,13 @@ class GoodsController extends Base
*/
public function addAction()
{
(new GoodsAddValidate())->validate();
$params = $this->params;
if (!empty($params["marketing_type"]) && $params["marketing_type"] == \App\Models\marketing\mysql\Marketing::MARKETING_TYPE_PINDAN) {
} else {
(new GoodsAddValidate())->validate();
}
GoodsService::addGoods($params);
$this->success();
}
......@@ -56,9 +60,13 @@ class GoodsController extends Base
*/
public function editAction()
{
(new GoodsEditValidate())->validate();
$params = $this->params;
if (!empty($params["marketing_type"]) && $params["marketing_type"] == \App\Models\marketing\mysql\Marketing::MARKETING_TYPE_PINDAN) {
} else {
(new GoodsEditValidate())->validate();
}
GoodsService::editGoods($params);
$this->success();
}
......
......@@ -104,13 +104,10 @@ class MarketingPindanGoodsService
"goods_name" => $spuData["marketing_name"],
"desc_pic_url" => $spuData["desc_pic_url"],
"desc" => $spuData["desc"],
"goods_type" => empty($spuData["goods_type"]) ? GoodsSpu::TYPE_VIRTUAL : $spuData["goods_type"],
"goods_sub_type" => empty($spuData["goods_sub_type"]) ? GoodsSpu::SUB_TYPE_TO_SHOP : $spuData["goods_sub_type"],
"goods_type" => empty($spuData["goods_type"]) ? GoodsSpu::TYPE_ENTITY : $spuData["goods_type"],
"goods_sub_type" => empty($spuData["goods_sub_type"]) ? GoodsSpu::SUB_TYPE_INSTANT : $spuData["goods_sub_type"],
"belong_type" => empty($spuData["belong_type"]) ? GoodsSpu::BELONG_TYPE_DISANFANG : $spuData["belong_type"],
"goods_sale_type" => empty($spuData["setmeal"]) ? GoodsSpu::SALE_TYPE_NO_COMBINATION : GoodsSpu::SALE_TYPE_COMBINATION,
"rule_limit" => $spuData["rule_limit"],
"rule_desc" => $spuData["rule_desc"],
"rule_refund" => $spuData["rule_refund"],
];
GoodsSpu::save($spuParams);
return $spuParams;
......@@ -267,8 +264,6 @@ class MarketingPindanGoodsService
$skuParams = [
"category_1_id" => $params["category_1_id"],
"category_2_id" => $params["category_2_id"],
"goods_name" => $params["goods_name"],
"desc_pic_url" => $params["desc_pic_url"],
"desc" => $params["desc"],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment