diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index 0ef059ad..b6b462ca 100644 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -47,7 +47,7 @@ class Goods extends Controller $param['channels'] = $this->storeInfo['open_channel'] ? array_merge(['zy'], explode(",", $this->storeInfo['open_channel'])) : []; //分类利润-利润率 $param['fliter_condition'] = $this->storeInfo['fliter_condition']; - $list = $model->getList($param); + $list = $model->getList($param, 10); return $this->renderSuccess(compact('list')); } diff --git a/app/common.php b/app/common.php index 98c782b0..7533cac2 100644 --- a/app/common.php +++ b/app/common.php @@ -612,3 +612,26 @@ function getGoodsCostAndProfitAndProfitRate($net_price, $cost_price, $rate){ $profit_rate = (float)$net_price > 0 ? bcmul(bcdiv((string)$profit, (string)$net_price, 4), (string)100, 2) : 0.00; return [$cost_price, $profit, $profit_rate]; } +/** + * 抓取京东商品信息 + * [getJdGoodsBySku description] + * @param [type] $skus [description] + * @return [type] [description] + */ +function getJdGoodsBySku($skus){ + $sku = implode(",", $skus); + $url = "http://47.98.251.206:8811/api/skus/info?skus=".$sku; + $res = httpRequest($url, "GET", null, [], false, 30); + return $res; +} + + + + + + + + + + + diff --git a/app/common/model/Goods.php b/app/common/model/Goods.php index e8fb7fc1..0d37639d 100644 --- a/app/common/model/Goods.php +++ b/app/common/model/Goods.php @@ -440,6 +440,10 @@ class Goods extends BaseModel $filter[] = ['status', '=', GoodsStatusEnum::OFF_SALE]; // 已下架 } elseif ($params['listType'] === 'sold_out') { $filter[] = ['stock_total', '=', 0]; // 已售罄 + } elseif ($params['listType'] === 'out_pool') { + $filter[] = ['is_pool', '=', 2]; // 已售罄 + } elseif ($params['listType'] === 'in_pool') { + $filter[] = ['is_pool', '=', 1]; // 已售罄 } if (isset($params['is_sale']) && $params['is_sale'] != "") { if ($params['is_sale'] == 1) { @@ -575,7 +579,10 @@ class Goods extends BaseModel if (isset($param['is_has_detail']) && $param['is_has_detail'] !== '') { $filter[] = ['goods.is_has_detail', '=', $params['is_has_detail']]; } - + if (isset($param['merchant_id']) && $param['merchant_id'] !== '') { + $filter[] = ['goods.merchant_id', '=', $params['merchant_id']]; + } + // 实例化新查询对象 return $query->where($filter); } diff --git a/app/common/model/Payment.php b/app/common/model/Payment.php index 55e71c8f..9d2a3080 100644 --- a/app/common/model/Payment.php +++ b/app/common/model/Payment.php @@ -196,20 +196,20 @@ class Payment extends BaseModel PaymentMethodEnum::WECHAT, PaymentMethodEnum::BALANCE, ]), - ClientEnum::H5 => $this->defaultGroup(ClientEnum::H5, [ - PaymentMethodEnum::WECHAT, - PaymentMethodEnum::ALIPAY, - PaymentMethodEnum::BALANCE, - ]), - ClientEnum::WXOFFICIAL => $this->defaultGroup(ClientEnum::WXOFFICIAL, [ - PaymentMethodEnum::WECHAT, - PaymentMethodEnum::BALANCE, - ]), - ClientEnum::APP => $this->defaultGroup(ClientEnum::APP, [ - PaymentMethodEnum::WECHAT, - PaymentMethodEnum::ALIPAY, - PaymentMethodEnum::BALANCE, - ]), + // ClientEnum::H5 => $this->defaultGroup(ClientEnum::H5, [ + // PaymentMethodEnum::WECHAT, + // PaymentMethodEnum::ALIPAY, + // PaymentMethodEnum::BALANCE, + // ]), + // ClientEnum::WXOFFICIAL => $this->defaultGroup(ClientEnum::WXOFFICIAL, [ + // PaymentMethodEnum::WECHAT, + // PaymentMethodEnum::BALANCE, + // ]), + // ClientEnum::APP => $this->defaultGroup(ClientEnum::APP, [ + // PaymentMethodEnum::WECHAT, + // PaymentMethodEnum::ALIPAY, + // PaymentMethodEnum::BALANCE, + // ]), ]; if (\config('plugin.mpAlipay.enable', false)) { $data[ClientEnum::MP_ALIPAY] = $this->defaultGroup(ClientEnum::MP_ALIPAY, [ diff --git a/app/store/controller/Merchant.php b/app/store/controller/Merchant.php index 68d5773b..cb374344 100644 --- a/app/store/controller/Merchant.php +++ b/app/store/controller/Merchant.php @@ -130,7 +130,8 @@ class Merchant extends Controller */ public function list(): Json { $model = new MerchantModel; - $list = $model->getList($this->request->param())->toArray(); + $param = $this->request->param(); + $list = $model->getList($param, (int)$param['pageSize'] ?? 15)->toArray(); foreach ($list['data'] as $kr => $r) { $res[$kr]['licenseImg'] = []; if ($r['license_img_id']) {