Commit 9bb66349 authored by jianghaiming's avatar jianghaiming

Merge branch 'develop' of https://gitlab.yidian-inc.com/bp/goods into develop

parents 9f79ace7 398dc7fc
...@@ -18,7 +18,9 @@ use App\Models\goods\mysql\GoodsSnapshot; ...@@ -18,7 +18,9 @@ use App\Models\goods\mysql\GoodsSnapshot;
use App\Models\goods\mysql\GoodsSpu; use App\Models\goods\mysql\GoodsSpu;
use App\Models\goods\mysql\PaySuccessGoodsCallbackRecord; use App\Models\goods\mysql\PaySuccessGoodsCallbackRecord;
use App\Models\goods\mysql\Shop; use App\Models\goods\mysql\Shop;
use App\Models\marketing\mysql\MarketingGoods;
use App\Models\shop\mysql\SubShop; use App\Models\shop\mysql\SubShop;
use App\Services\marketing\MarketingGoodsService;
use App\Services\shop\ShopService; use App\Services\shop\ShopService;
use Api\PhpUtils\Http\Request; use Api\PhpUtils\Http\Request;
use App\Exception\custom\InterfaceException; use App\Exception\custom\InterfaceException;
...@@ -573,8 +575,8 @@ class GoodsService ...@@ -573,8 +575,8 @@ class GoodsService
"rule_limit" => $params["rule_limit"], "rule_limit" => $params["rule_limit"],
"rule_desc" => $params["rule_desc"], "rule_desc" => $params["rule_desc"],
"rule_refund" => $params["rule_refund"], "rule_refund" => $params["rule_refund"],
"rule_start_time" => $params["rule_start_time"], "rule_start_time" => empty($params["rule_start_time"]) ? "" : $params["rule_start_time"],
"rule_end_time" => $params["rule_end_time"], "rule_end_time" => empty($params["rule_end_time"]) ? "" : $params["rule_end_time"],
"inventory_total" => $skuData["inventory_total"] + $params["inventory_add"], "inventory_total" => $skuData["inventory_total"] + $params["inventory_add"],
"inventory_rest" => $inventoryCount, "inventory_rest" => $inventoryCount,
"original_price" => $params["original_price"] * 100, "original_price" => $params["original_price"] * 100,
...@@ -701,6 +703,9 @@ class GoodsService ...@@ -701,6 +703,9 @@ class GoodsService
$subShopList = SubShop::select("*", ["sub_shop_id" => $subShopIds]); $subShopList = SubShop::select("*", ["sub_shop_id" => $subShopIds]);
$data["goods_info"]["sub_shop"] = $subShopList; $data["goods_info"]["sub_shop"] = $subShopList;
} }
// $marketingGoodsList = MarketingGoodsService::getRunningMarketing([$sku["goods_sku_id"]]);
// var_dump($marketingGoodsList);exit;
} }
} }
$recordList = GoodsOperationRecord::select("*", ["goods_spu_id" => $goodsSpuId]); $recordList = GoodsOperationRecord::select("*", ["goods_spu_id" => $goodsSpuId]);
......
...@@ -70,6 +70,17 @@ class MarketingGoodsService ...@@ -70,6 +70,17 @@ class MarketingGoodsService
$result = ['result' => $list ,'last_id' => $lastId]; $result = ['result' => $list ,'last_id' => $lastId];
return $result; return $result;
} }
public static function getRunningMarketing($goodsSkuIds)
{
$goodsSkuIds = ["awPYXhAUBJ4HCT6k", "awPZqLl5KtXQZh6k"];
$marketingIds = MarketingGoods::select("marketing_id", ["goods_sku_id" => $goodsSkuIds]);
if (!empty($marketingIds)) {
$now = date("Y-m-d H:i:s");
$marketingList = Marketing::select("*", ["start_time[<]"=>$now, "end_time[>]"=>$now, "marketing_id"=>$goodsSkuIds]);
var_dump($marketingList);exit;
}
}
} }
......
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