Commit 2d88ee1c authored by jianghaiming's avatar jianghaiming

update:set

parent 2494e555
...@@ -28,7 +28,7 @@ trait ApiResponse ...@@ -28,7 +28,7 @@ trait ApiResponse
* @return void * @return void
* @throws \Exception * @throws \Exception
*/ */
public function failed($code, $status = "failed", $reason = '', $headers = []) public function failed($code, $reason = '', $status = "failed", $headers = [])
{ {
$this->respond($code, $status, $reason, [], $headers); $this->respond($code, $status, $reason, [], $headers);
} }
......
...@@ -197,4 +197,12 @@ class GoodsController extends Base ...@@ -197,4 +197,12 @@ class GoodsController extends Base
$this->success(["result" => $data]); $this->success(["result" => $data]);
} }
public function goods_sku_listAction()
{
$params = $this->params;
$data = GoodsService::getGoodsSkuList($params);
$this->success(["result" => $data]);
}
} }
\ No newline at end of file
...@@ -1015,4 +1015,41 @@ class GoodsService ...@@ -1015,4 +1015,41 @@ class GoodsService
return $data; return $data;
} }
/**
* 获取 GoodsSku 列表
* @param $params
* @return array
* @throws GoodsException
*/
public static function getGoodsSkuList($params)
{
$where = [];
if (empty($params)) {
return [];
}
if (!empty($params['goods_sku_id'])) {
$where['goods_sku_id'] = $params['goods_sku_id'];
}
if (!empty($params['goods_spu_id'])) {
$where['goods_spu_id'] = $params['goods_spu_id'];
}
if (!empty($params['life_account_id'])) {
$where['life_account_id'] = $params['life_account_id'];
}
if (!empty($params['shop_id'])) {
$where['shop_id'] = $params['shop_id'];
}
if (!empty($params['goods_name'])) {
$where['goods_name'] = $params['goods_name'];
}
$list = GoodsSku::getRecordMaster($where);
return $list;
}
} }
\ No newline at end of file
...@@ -88,15 +88,25 @@ class ShopService ...@@ -88,15 +88,25 @@ class ShopService
public static function getShopList($params) public static function getShopList($params)
{ {
$lifeAccountId = !empty($params['life_account_id']) ? $params['life_account_id'] : 11; $lifeAccountId = !empty($params['life_account_id']) ? $params['life_account_id'] : '';
$phone = !empty($params['phone']) ? $params['phone'] : ''; $phone = !empty($params['phone']) ? $params['phone'] : '';
$shopId = !empty($params['shop_id']) ? $params['shop_id'] : ''; $shopId = !empty($params['shop_id']) ? $params['shop_id'] : '';
$shop_name = !empty($params['shop_name']) ? $params['shop_name'] : ''; $shop_name = !empty($params['shop_name']) ? $params['shop_name'] : '';
$longitude = !empty($params['longitude']) ? $params['longitude'] : ''; $longitude = !empty($params['longitude']) ? $params['longitude'] : '';
$latitude = !empty($params['latitude']) ? $params['latitude'] : ''; $latitude = !empty($params['latitude']) ? $params['latitude'] : '';
$address = !empty($params['address']) ? $params['address'] : ''; $address = !empty($params['address']) ? $params['address'] : '';
$subShopId = !empty($params['sub_shop_id']) ? $params['sub_shop_id'] : '';
$where['life_account_id'] = $lifeAccountId; if (!empty($subShopId)) {
$where['sub_shop_id'] = $subShopId;
}
if (!empty($lifeAccountId)) {
$where['life_account_id'] = $lifeAccountId;
}
$where['ORDER'] = ["create_time" => "DESC"]; $where['ORDER'] = ["create_time" => "DESC"];
$subShopList = SubShop::getRecords($where); $subShopList = SubShop::getRecords($where);
return $subShopList; return $subShopList;
......
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