Commit 00c0ace0 authored by luhongguang's avatar luhongguang

update:拼单商品后台搜商品

parent d0d20c31
......@@ -20,6 +20,7 @@ use App\Models\goods\mysql\GoodsSkuSubShop;
use App\Models\goods\mysql\GoodsSnapshot;
use App\Models\goods\mysql\GoodsSpu;
use App\Models\goods\mysql\LifeAccountShopNum;
use App\Models\goods\mysql\Ota;
use App\Models\goods\mysql\PaySuccessGoodsCallbackRecord;
use App\Models\goods\mysql\PindanGoodsSku;
use App\Models\goods\mysql\PindanGoodsSnapshot;
......@@ -359,11 +360,24 @@ class MarketingPindanGoodsService
$where['ORDER'] = ["update_time" => "DESC"];
$list = PindanGoodsSku::select("*", $where);
$otaData = [];
if (!empty($list)) {
$otaIds = array_unique(array_column($list, "ota_id"));
$otaList = Ota::select(["ota_id", "ota_name"], ["ota_id" => $otaIds]);
if (!empty($otaList)) {
foreach ($otaList as $item) {
$otaData[$item["ota_id"]] = $item;
}
}
}
$count = PindanGoodsSku::count("*", $where);
if (!empty($list)) {
foreach ($list as $key => $item) {
$list[$key]["original_price"] = $item["original_price"] / 100;
$list[$key]["price"] = $item["price"] / 100;
if (!empty($otaData) && !empty($otaData[$item["ota_id"]])) {
$list[$key]["ota_name"] = $otaData[$item["ota_id"]]["ota_name"];
}
}
}
......
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