lqmac 7 months ago
commit 888fa4d1ff
  1. 23
      app/api/controller/Goods.php
  2. 1
      app/api/model/user/BalanceLog.php

@ -15,8 +15,10 @@ namespace app\api\controller;
use app\api\model\{Goods as GoodsModel, Store as StoreModel};
use app\api\model\Region;
use app\api\service\{Goods as GoodsService, User as UserService};
use app\common\library\wechat\ShortLink;
use app\common\model\GoodsImage as GoodsImageModel;
use app\common\model\UploadFile as UploadFileModel;
use app\common\model\wxapp\Setting as WxappSettingModel;
use app\common\service\qrcode\Goods as GoodsPoster;
use cores\exception\BaseException;
use think\db\exception\DbException;
@ -97,7 +99,6 @@ class Goods extends Controller
'state' => "无货",
'goods_name' => $goods['goods_name'],
'goods_id' => $goods['goods_id'],
'promise_info' => "预计".(GoodsDeliveryTime::data()[$goods['delivery_time']] ?? "72小时")."内发货",
];
$return[] = $data;
continue;
@ -111,7 +112,6 @@ class Goods extends Controller
$data = $suning->shoppingCartPrice([$goods->toArray()], $city->sn_code, $district->sn_code);
$data['goods_name'] = $goods['goods_name'];
$data['goods_id'] = $goods['goods_id'];
$data['promise_info'] = "预计".(GoodsDeliveryTime::data()[$goods['delivery_time']] ?? "72小时")."内发货";
break;
case 'jd':
case 'jd1':
@ -134,7 +134,6 @@ class Goods extends Controller
'state' => $res,
'goods_name' => $goods['goods_name'],
'goods_id' => $goods['goods_id'],
'promise_info' => $ret['promiseInfo'] ?? "预计72小时内发货",
];
break;
default:
@ -145,7 +144,6 @@ class Goods extends Controller
'state' => $res,
'goods_name' => $goods['goods_name'],
'goods_id' => $goods['goods_id'],
'promise_info' => "预计".(GoodsDeliveryTime::data()[$goods['delivery_time']] ?? "72小时")."内发货",
];
break;
@ -387,5 +385,22 @@ class Goods extends Controller
return $this->renderSuccess(['imageUrl' => $Qrcode->getImage()]);
}
public function shortUrl(): Json
{
$page_url = $this->request->post('page_url');
if (empty($page_url)) {
return $this->renderError('缺少参数page_url');
}
$page_title = $this->request->post('page_title');
if (empty($page_title)) {
return $this->renderError('缺少参数page_title');
}
$store_id = GoodsModel::$storeId;
$wxConfig = WxappSettingModel::getConfigBasic($store_id);
// 请求api获取短连接
$link_obj = new ShortLink($wxConfig['app_id'], $wxConfig['app_secret']);
$url = $link_obj->shortUrl($page_url, $page_title);
return $this->renderSuccess(['url' => $url]);
}
}

@ -40,6 +40,7 @@ class BalanceLog extends BalanceLogModel
{
// 当前用户ID
$userId = UserService::getCurrentLoginUserId();
// $userId = 10089;
// 获取列表数据
$query = $this->where('user_id', '=', $userId);
if (!empty($params['type'])) {

Loading…
Cancel
Save