Commit 5e7d3799 authored by luhongguang's avatar luhongguang

update:增加拼单商品

parent 8a200f38
...@@ -16,6 +16,7 @@ use \Validate\PaySuccessGoodsCallbackValidate; ...@@ -16,6 +16,7 @@ use \Validate\PaySuccessGoodsCallbackValidate;
use \Validate\GoodsInitShopValidate; use \Validate\GoodsInitShopValidate;
use \App\Services\goods\ElasticGoodService; use \App\Services\goods\ElasticGoodService;
use \App\Services\goods\MarketingPindanGoodsService; use \App\Services\goods\MarketingPindanGoodsService;
use \App\Models\marketing\mysql\Marketing;
class GoodsController extends Base class GoodsController extends Base
...@@ -46,15 +47,19 @@ class GoodsController extends Base ...@@ -46,15 +47,19 @@ class GoodsController extends Base
public function addAction() public function addAction()
{ {
$params = $this->params; $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 { } else {
(new GoodsAddValidate())->validate(); (new GoodsAddValidate())->validate();
} }
GoodsService::addGoods($params); $res = GoodsService::addGoods($params);
if (!empty($params["marketing_type"]) && $params["marketing_type"] == Marketing::MARKETING_TYPE_PINDAN) {
$this->success(["result" => $res]);
} else {
$this->success(); $this->success();
} }
}
/** /**
* 编辑商品 * 编辑商品
...@@ -62,7 +67,7 @@ class GoodsController extends Base ...@@ -62,7 +67,7 @@ class GoodsController extends Base
public function editAction() public function editAction()
{ {
$params = $this->params; $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 { } else {
(new GoodsEditValidate())->validate(); (new GoodsEditValidate())->validate();
......
...@@ -75,7 +75,21 @@ class MarketingPindanGoodsService ...@@ -75,7 +75,21 @@ class MarketingPindanGoodsService
GoodsSpu::rollback(); GoodsSpu::rollback();
throw new GoodsException(["cus" => 0]); 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 ...@@ -384,6 +398,12 @@ class MarketingPindanGoodsService
return ["list" => $list, "count" => $count]; return ["list" => $list, "count" => $count];
} }
/**
* 获取拼单商品详情
* @param $params
* @return array
* @throws GoodsException
*/
public static function pindanGoodsInfo($params) public static function pindanGoodsInfo($params)
{ {
$data = []; $data = [];
......
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