Commit 73e3960c authored by luhongguang's avatar luhongguang

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

parents 2bd425f8 a239c555
......@@ -31,6 +31,14 @@ class GoodsSpu extends MysqlBase
return self::get($colums, $where);
}
public static function getRecords($where, $colums = [])
{
if (empty($colums)) {
$colums = '*';
}
return self::select($colums, $where);
}
public static function getRecordMaster($where, $colums = [])
{
if (empty($colums)) {
......
......@@ -216,6 +216,15 @@ class GoodsController extends Base
$this->success(["result" => $data]);
}
public function goods_spu_listAction()
{
$params = $this->params;
$data = GoodsService::getGoodsSpuList($params);
$this->success(["result" => $data]);
}
/**
* 支付回调商品接口
* @throws \App\Exception\custom\GoodsException
......
......@@ -9,7 +9,7 @@ use Api\PhpServices\JwUser\JwUser;
use Api\PhpServices\Ksy\Ksyun;
class MarketinggoodsController extends Base
{
const KS3_BASE_URL = 'ks3-cn-beijing.ksyun.com';
/**
* 获取全部生效营销活动商品列表
*
......
......@@ -1155,6 +1155,40 @@ class GoodsService
return $list;
}
/**
* 获取 GoodsSpu 列表
* @param $params
* @return array
* @throws GoodsException
*/
public static function getGoodsSpuList($params)
{
$where = [];
if (empty($params)) {
return [];
}
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 = GoodsSpu::getRecords($where);
return $list;
}
/**
* 获取图片地址,这里因为bucket可能不同,不保证图片顺序
* @param $picUrlStr
......
......@@ -101,7 +101,18 @@ class MarketingService
}
if (!empty($params['online_status'])) {
$where['online_status'] = $params['online_status'];
if (is_array($params['online_status'])) {
foreach ($params['online_status'] as $key => $valu) {
if (!empty($valu)) {
$where['online_status'][$key] = $valu;
}else{
$where['online_status'] = [1,2];
break;
}
}
}else{
$where['online_status'] = $params['online_status'];
}
}
if (!empty($params['goods_sku_id'])) {
......
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