lqmac 6 months ago
parent c8ab7b9a7c
commit 507448c958
  1. 2
      app/api/controller/Goods.php
  2. 23
      app/common.php
  3. 7
      app/common/model/Goods.php
  4. 28
      app/common/model/Payment.php
  5. 3
      app/store/controller/Merchant.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'));
}

@ -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;
}

@ -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,6 +579,9 @@ 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);

@ -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, [

@ -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']) {

Loading…
Cancel
Save