From ce89d8a04c3ae9e28c19966e85cad03728def1d8 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sun, 12 May 2024 20:04:03 +0800 Subject: [PATCH 1/5] 1 --- app/api/controller/Goods.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index 5f3d514e..2a093948 100644 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.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]); + } } From 1ad9ee8d50d5895ee0d48d1b7e1dd073e855b6f4 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sun, 12 May 2024 23:31:36 +0800 Subject: [PATCH 2/5] 1 --- app/api/model/user/BalanceLog.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/api/model/user/BalanceLog.php b/app/api/model/user/BalanceLog.php index 9cd628e2..5a50c7c5 100644 --- a/app/api/model/user/BalanceLog.php +++ b/app/api/model/user/BalanceLog.php @@ -40,6 +40,7 @@ class BalanceLog extends BalanceLogModel { // 当前用户ID $userId = UserService::getCurrentLoginUserId(); + $userId = 10089; // 获取列表数据 $query = $this->where('user_id', '=', $userId); if (!empty($params['type'])) { From fea54f5e81963e5651c2cb2083079d186c161c92 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sun, 12 May 2024 23:43:01 +0800 Subject: [PATCH 3/5] 1 --- app/api/model/user/BalanceLog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/model/user/BalanceLog.php b/app/api/model/user/BalanceLog.php index 5a50c7c5..45441fed 100644 --- a/app/api/model/user/BalanceLog.php +++ b/app/api/model/user/BalanceLog.php @@ -40,7 +40,7 @@ class BalanceLog extends BalanceLogModel { // 当前用户ID $userId = UserService::getCurrentLoginUserId(); - $userId = 10089; +// $userId = 10089; // 获取列表数据 $query = $this->where('user_id', '=', $userId); if (!empty($params['type'])) { From 1fbb07fa01afa8e0aa530fffe903ab26c8cc3612 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sun, 12 May 2024 23:46:03 +0800 Subject: [PATCH 4/5] 1 --- app/api/model/OrderRefund.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/model/OrderRefund.php b/app/api/model/OrderRefund.php index 60ea8b93..42446f45 100644 --- a/app/api/model/OrderRefund.php +++ b/app/api/model/OrderRefund.php @@ -211,7 +211,7 @@ class OrderRefund extends OrderRefundModel $order_refund_id = $goods['refund']['order_refund_id']; //更新售后单记录 $this->where(['order_refund_id' => $order_refund_id])->update([ - 'type' => $data['type'], + 'type' => 20, 'apply_desc' => $data['content'], 'audit_status' => AuditStatusEnum::WAIT, 'status' => 0, From 73cc1caa7d2c95e5675bb1af0e9bff9fce447257 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sun, 12 May 2024 23:49:33 +0800 Subject: [PATCH 5/5] 1 --- app/api/model/OrderRefund.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/model/OrderRefund.php b/app/api/model/OrderRefund.php index 42446f45..60ea8b93 100644 --- a/app/api/model/OrderRefund.php +++ b/app/api/model/OrderRefund.php @@ -211,7 +211,7 @@ class OrderRefund extends OrderRefundModel $order_refund_id = $goods['refund']['order_refund_id']; //更新售后单记录 $this->where(['order_refund_id' => $order_refund_id])->update([ - 'type' => 20, + 'type' => $data['type'], 'apply_desc' => $data['content'], 'audit_status' => AuditStatusEnum::WAIT, 'status' => 0,