Commit 1d47974b authored by luhongguang's avatar luhongguang

update:op后台展示商品详情

parent 7b5d8f05
...@@ -18,9 +18,22 @@ class GoodsOperationRecord extends MysqlBase ...@@ -18,9 +18,22 @@ class GoodsOperationRecord extends MysqlBase
const STATUS_PASS = 1;//审核通过 const STATUS_PASS = 1;//审核通过
const STATUS_REJECT = 2;//审核驳回 const STATUS_REJECT = 2;//审核驳回
public static $statusDesc = [
self::STATUS_AUDIT => "待审核",
self::STATUS_PASS => "审核通过",
self::STATUS_REJECT => "审核驳回",
];
const ONLINE_STATUS_UN_ONLINE = 0;//未上架
const ONLINE_STATUS_ONLINE = 1;//已上架 const ONLINE_STATUS_ONLINE = 1;//已上架
const ONLINE_STATUS_OFFLINE = 2;//已下架 const ONLINE_STATUS_OFFLINE = 2;//已下架
public static $onlineStatusDesc = [
self::ONLINE_STATUS_UN_ONLINE => "未上架",
self::ONLINE_STATUS_ONLINE => "已上架",
self::ONLINE_STATUS_OFFLINE => "已下架",
];
public static function getRecord($where, $colums = []) public static function getRecord($where, $colums = [])
{ {
if (empty($colums)) { if (empty($colums)) {
......
...@@ -13,6 +13,7 @@ use App\Models\goods\mysql\GoodsOperationRecord; ...@@ -13,6 +13,7 @@ use App\Models\goods\mysql\GoodsOperationRecord;
use App\Models\goods\mysql\GoodsSku; use App\Models\goods\mysql\GoodsSku;
use App\Models\goods\mysql\GoodsSpu; use App\Models\goods\mysql\GoodsSpu;
use App\Models\goods\mysql\Shop; use App\Models\goods\mysql\Shop;
use App\Services\shop\ShopService;
class GoodsService class GoodsService
{ {
...@@ -561,14 +562,27 @@ class GoodsService ...@@ -561,14 +562,27 @@ class GoodsService
//当前这里一个spu对应一个sku //当前这里一个spu对应一个sku
if (!empty($goodsSkuList)) { if (!empty($goodsSkuList)) {
foreach ($goodsSkuList as $key => $sku) { foreach ($goodsSkuList as $key => $sku) {
//todo::图片处理,门店,套餐,生活号信息 //todo::图片处理
$data["goods_info"] = $sku; $data["goods_info"] = $sku;
$subShopList = ShopService::getSubShopList($sku["shop_id"]);
if (!empty($subShopList)) {
foreach ($subShopList as $key => $subShop) {
$data["goods_info"]["sub_shop"][$key] = $subShop;
}
}
} }
} }
$recordList = GoodsOperationRecord::select("*", ["goods_spu_id" => $goodsSpuId]); $recordList = GoodsOperationRecord::select("*", ["goods_spu_id" => $goodsSpuId]);
if (!empty($recordList)) { if (!empty($recordList)) {
//todo::处理展示内容 foreach ($recordList as $key => $record) {
$data["record_list"] = $recordList; $data["record_list"][$key]["status"] = $record["goods_status"];
$data["record_list"][$key]["status_desc"] = GoodsOperationRecord::$statusDesc[$record["goods_status"]];
$data["record_list"][$key]["online_status"] = $record["online_status"];
$data["record_list"][$key]["online_status_desc"] = GoodsOperationRecord::$onlineStatusDesc[$record["online_status"]];
$data["record_list"][$key]["create_time"] = $record["create_time"];
$data["record_list"][$key]["operator_name"] = $record["operator_name"];
$data["record_list"][$key]["note"] = $record["note"];
}
} }
return $data; return $data;
} }
......
...@@ -248,4 +248,14 @@ class ShopService ...@@ -248,4 +248,14 @@ class ShopService
"count" => $count]], []); "count" => $count]], []);
return $res['id_snow'][$type] ?? []; return $res['id_snow'][$type] ?? [];
} }
/**
* 获取制定 shop_id 下的门店
* @param $shopId
* @return \Api\PhpUtils\Mysql\MysqlBase
*/
public static function getSubShopList($shopId)
{
return SubShop::select("*", ["shop_id"=>$shopId]);
}
} }
\ No newline at end of file
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