Forráskód Böngészése

Merge branch 'liuxiangxin' into jun

jun 4 hónapja
szülő
commit
986d916b16

+ 1 - 1
app/Http/Controllers/Admin/CouponActive.php

@@ -60,7 +60,7 @@ class CouponActive extends Auth{
         // 不存在数据
         if ( is_null($link) ) {
             // 从数据库获取数据
-            $link              = Mini::getUrlLink('pages/coupon/active','?id='.$id);
+            $link              = Mini::getUrlLink('pages/coupon/active','id='.$id);
             // 存起来
             cache(['admin:coupon:active:urllink:'.$id=>$link],$link ? now()->addDays(28) : now()->addMinutes(3));
         }

+ 1 - 1
app/Http/Controllers/Api/Product.php

@@ -367,7 +367,7 @@ class Product extends Api{
         // 接口验签
         // $this->verify_sign();
         // 检查登录
-        //$uid						= $this->checkLogin();
+        $uid						= $this->getUid();
         // 获取产品类型
         $list						= $ProductType->getList();
         // 转数组

+ 2 - 1
app/Models/CouponProduct.php

@@ -79,7 +79,7 @@ class CouponProduct extends Model
 
 
     /**
-     * 查询个优惠券的商品范围
+     * 查询个优惠券的商品范围
      * 
      * @param   array  $couponId  优惠券的
      * 
@@ -90,6 +90,7 @@ class CouponProduct extends Model
         $list						    = $this->query()
                                             ->join('product','coupon_product.product_id','=','product.id')
                                             ->whereIn('coupon_id',$couponIds)
+                                            ->where([['coupon_product.status','=',0]])
                                             ->get(['product.name as product_name','product.id as product_id','product.thumb as thumb','product.price as price','product.market_price as market_price','product.stock as stock'])
                                             ->toArray();
         // 返回结果

+ 10 - 10
app/Servers/WechatPay/Payment.php

@@ -19,7 +19,7 @@ class Payment
     function __construct()
     {
         // 从本地文件中加载「商户API私钥」,「商户API私钥」会用来生成请求的签名
-        $merchantPrivateKeyFilePath = Config('wechatpay.private_key');
+        $merchantPrivateKeyFilePath = config('wechatpay.private_key');
         //$merchantPrivateKeyFilePath = 'file://D:\phpstudy_pro\WWW\mall\kailin\resources\1612111355_20241118_cert\apiclient_key.pem';
         $merchantPrivateKeyInstance = Rsa::from($merchantPrivateKeyFilePath, Rsa::KEY_TYPE_PRIVATE);
 
@@ -27,7 +27,7 @@ class Payment
         $merchantCertificateSerial = '4A5F7CFCC3280CF8C09735D5FC2DEFBC9CCD6F46';
 
         // 从本地文件中加载「微信支付平台证书」或者「微信支付平台公钥」,用来验证微信支付应答的签名
-        $platformCertificateOrPublicKeyFilePath = Config('wechatpay.platformCertificate');
+        $platformCertificateOrPublicKeyFilePath = config('wechatpay.platformCertificate');
         $platformPublicKeyInstance =    Rsa::from($platformCertificateOrPublicKeyFilePath, Rsa::KEY_TYPE_PUBLIC);
 
         // 「微信支付平台证书」的「证书序列号」或者是「微信支付平台公钥ID」
@@ -36,7 +36,7 @@ class Payment
 
         // 构造一个 APIv3 客户端实例
         $instance = Builder::factory([
-            'mchid'      => Config('wechatpay.mchid'),
+            'mchid'      => config('wechatpay.mchid'),
             'serial'     => $merchantCertificateSerial,
             'privateKey' => $merchantPrivateKeyInstance,
             'certs'      => [
@@ -44,10 +44,10 @@ class Payment
             ],
         ]);
         $this->instance   = $instance;
-        $this->appid   = Config('wechatpay.appid');
-        $this->mchid   = Config('wechatpay.mchid');
+        $this->appid   = config('wechatpay.appid');
+        $this->mchid   = config('wechatpay.mchid');
         $this->merchantPrivateKeyInstance   = $merchantPrivateKeyInstance;
-        $this->merchantCertificateSerial   = Config('wechat.certificate');
+        $this->merchantCertificateSerial   = config('wechat.certificate');
         return;
     }
     /**
@@ -55,7 +55,7 @@ class Payment
      */
     public function pay($params)
     {
-        $notify_url = Config('wechatpay.notify_url');
+        $notify_url = config('wechatpay.notify_url');
         //调用微信JSAPI下单获取预支付交易会话标识
         try {
             $resp = $this->instance
@@ -66,7 +66,7 @@ class Payment
                     'appid'        => $this->appid,
                     'description'  => $params['description'],
                     /*'time_expire'  => $this->timestampToRfc3339(time() + env('ORDER_OUT_TIME')*60),*/
-                    'notify_url'   => env('APP_URL').'/api/wechat_pay/notify',
+                    'notify_url'   => $notify_url,
                     'amount'       => [
                         //'total'    => 1,
                         'total'    => $params['total_price']*100,
@@ -125,7 +125,7 @@ class Payment
      */
     public function refund($params)
     {
-        $notify_url = Config('wechat.course_refund_notify_url');
+        $notify_url = config('wechatpay.refund_notify_url');
         try {
             $resp = $this->instance
                 ->chain('v3/refund/domestic/refunds')
@@ -133,7 +133,7 @@ class Payment
                     'out_trade_no'      => $params['out_trade_no'],
                     'out_refund_no'   => $params['out_refund_no'],
                     'reason'          => $params['reason'] ?? '用户退款',
-                    'notify_url'      => env('APP_URL').'/api/wechat_pay/refund_notify',
+                    'notify_url'      => $notify_url,
                     'amount'          => [
                         'refund'      => $params['refund'] * 100,
                         'total'       => $params['total'] * 100,

+ 1 - 1
config/wechat.php

@@ -15,7 +15,7 @@ return [
     'work'=>[
         'corp_id' => env('WECHAT_WORK_CORP_ID', 'wwcdbc686326b51a89'),
         'agent_id' => env('WECHAT_WORK_AGENT_ID', 1000010),
-        'secret'   => env('WECHAT_WORK_SECRET', '2h70XsEbIM1FeagstX2WxzSEeoETqmepXH-uNsqgA5'),
+        'secret'   => env('WECHAT_WORK_SECRET', '2h70XsEbIM1FeagstX2WxzSEeoETqmepXH-uNsqgA5k'),
         'response_type' => 'array',
         // server config
         'token' => env('WECHAT_WORK_TOKEN', 'Efd61RPH3GzEwfEATRwdJVKhi'),

+ 1 - 0
config/wechatpay.php

@@ -5,6 +5,7 @@ return array(
     'certificate'           => '68E43B250D73977F1DC0E0D0827AF25A8BFB1777', //证书序列号
     'APIV3'                 => 'iD1xB1mH6zO7pP2wD1rU4aD2nH7oL2lN',
     'notify_url'            => env('APP_URL').'/api/wechat_pay/notify',
+    'refund_notify_url'     => env('APP_URL').'/api/wechat_pay/refund_notify',
     'private_key'           => '-----BEGIN PRIVATE KEY-----
 MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDBcmSf2j2gN8Ie
 +vx0GxqFDzxetgJX+sCju9wyxSiPiFGqNRp1dXyzmb0WMDZ4EHSuwhgMp9xdY6BE