فهرست منبع

Merge branch 'master' of e.coding.net:zdap/weixiu/weixiu_api into performance-m

liugc 1 سال پیش
والد
کامیت
d039958993

+ 8 - 2
app/adminapi/logic/goods/GoodsLogic.php

@@ -15,6 +15,8 @@
 namespace app\adminapi\logic\goods;
 namespace app\adminapi\logic\goods;
 
 
 
 
+use app\adminapi\logic\external\ExternalPlatformGoodsLogic;
+use app\adminapi\service\PlatformGoodsService;
 use app\common\model\goods\Goods;
 use app\common\model\goods\Goods;
 use app\common\logic\BaseLogic;
 use app\common\logic\BaseLogic;
 use app\common\model\goods_category\GoodsCategory;
 use app\common\model\goods_category\GoodsCategory;
@@ -60,6 +62,7 @@ class GoodsLogic extends BaseLogic
                 $params['is_agent'] = 0;
                 $params['is_agent'] = 0;
                 $params['is_activity'] = 0;
                 $params['is_activity'] = 0;
             }
             }
+            $platform_value = $params['platform_value']??0;
             $goods = Goods::create([
             $goods = Goods::create([
                 'goods_category_ids' => $params['goods_category_ids'],
                 'goods_category_ids' => $params['goods_category_ids'],
                 'category_type' => GoodsCategory::where('id',$params['goods_category_id'])->value('category_type'),
                 'category_type' => GoodsCategory::where('id',$params['goods_category_id'])->value('category_type'),
@@ -94,7 +97,7 @@ class GoodsLogic extends BaseLogic
                 'labels' => (isset($params['labels']) && $params['labels'])?implode(',',$params['labels']):'',
                 'labels' => (isset($params['labels']) && $params['labels'])?implode(',',$params['labels']):'',
                 'activity_service_fee' => $params['activity_service_fee'] ??'',
                 'activity_service_fee' => $params['activity_service_fee'] ??'',
                 'sell_num'=>!empty($params['sell_num'])?$params['sell_num']:0,
                 'sell_num'=>!empty($params['sell_num'])?$params['sell_num']:0,
-                'platform_value'=>$params['platform_value']??0,
+                'platform_value'=>$platform_value,
             ]);
             ]);
 
 
             //更新绩效规则
             //更新绩效规则
@@ -121,8 +124,11 @@ class GoodsLogic extends BaseLogic
                 $rule->rate = $params['rate'];
                 $rule->rate = $params['rate'];
             }
             }
             $rule->save();
             $rule->save();
-
             Db::commit();
             Db::commit();
+
+            if($platform_value>0) {
+                PlatformGoodsService::synchronizeGoods($goods->id, $platform_value, $params);
+            }
             return true;
             return true;
         } catch (\Exception $e) {
         } catch (\Exception $e) {
             Db::rollback();
             Db::rollback();

+ 49 - 0
app/adminapi/service/PlatformGoodsService.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace app\adminapi\service;
+
+use app\adminapi\logic\external\ExternalPlatformGoodsLogic;
+use app\api\service\DouYinService;
+use app\common\model\external\ExternalPlatform;
+use think\facade\Log;
+
+class PlatformGoodsService
+{
+    /**
+     * 同步到外部平台
+     * @param $lon
+     * @param $lat
+     * @param $resType
+     * @param $ids
+     * @author liugc <466014217@qq.com>
+     * @date 2025/6/8 9:29
+     */
+    public static function synchronizeGoods($goods_id, $platform_id, $params = [])
+    {
+        try {
+            // 判断平台配置 是否同步商品库 is_synchronize 是否同步外部 is_synchronize_external
+            $is_synchronize = ExternalPlatform::getPlatformConfig($platform_id,'is_synchronize');
+            if($is_synchronize){
+                $result = ExternalPlatformGoodsLogic::add([
+                    'service_fee' => $params['service_fee']??0,
+                    'goods_status' => 1,
+                    'goods_id' => $goods_id,
+                    'external_goods_sn' => '',
+                    'external_platform_id' => $platform_id,
+                ]);
+                if (true === $result) {
+                    $is_synchronize_external = ExternalPlatform::getPlatformConfig($platform_id,'is_synchronize_external');
+                    if($is_synchronize_external){
+                        // tmp固定 - goods_category_id goods_id external_platform_id
+                        // TODO: tmp固定platform_id
+                        $platform_id == 6 && DouYinService::addProduct(['goods_category_id'=>$params['goods_category_id']??0,'goods_id'=>$goods_id,'external_platform_id'=>$platform_id]);
+                    }
+                }
+            }
+            return true;
+        } catch (\Exception $e) {
+            Log::info('synchronizeGoods:'.$e->getMessage());
+            return false;
+        }
+    }
+}

+ 32 - 18
app/api/controller/DouYinController.php

@@ -44,7 +44,7 @@ class DouYinController extends BaseApiController
 
 
     public function getClientToken()
     public function getClientToken()
     {
     {
-        $access_token = DouYinService::getClientToken();
+        $access_token = DouYinService::getClientToken($this->request->get()['isRefresh']??false);
         return $this->success('',['access_token'=>$access_token]);
         return $this->success('',['access_token'=>$access_token]);
     }
     }
     /**
     /**
@@ -145,7 +145,7 @@ class DouYinController extends BaseApiController
      * @author liugc <466014217@qq.com>
      * @author liugc <466014217@qq.com>
      * @date 2025/5/22 14:35
      * @date 2025/5/22 14:35
      */
      */
-    public function submitOrder()
+    /*public function submitOrder()
     {
     {
         try {
         try {
             $params = $this->request->post();
             $params = $this->request->post();
@@ -158,15 +158,14 @@ class DouYinController extends BaseApiController
         } catch (\Exception $e) {
         } catch (\Exception $e) {
             return $this->fail($e->getMessage());
             return $this->fail($e->getMessage());
         }
         }
-    }
-
+    }*/
     /**
     /**
      * 拉起支付所需参数
      * 拉起支付所需参数
      * @return \think\response\Json
      * @return \think\response\Json
      * @author liugc <466014217@qq.com>
      * @author liugc <466014217@qq.com>
      * @date 2025/5/22 14:35
      * @date 2025/5/22 14:35
      */
      */
-    public function requestOrderData()
+    /*public function requestOrderData()
     {
     {
         try {
         try {
             $params = $this->request->post();
             $params = $this->request->post();
@@ -178,23 +177,23 @@ class DouYinController extends BaseApiController
         } catch (\Exception $e) {
         } catch (\Exception $e) {
             return $this->fail($e->getMessage());
             return $this->fail($e->getMessage());
         }
         }
-    }
-    /**
-     * 取消订单
-     * @return \think\response\Json
-     * @author liugc <466014217@qq.com>
-     * @date 2025/5/22 14:35
-     */
-    public function cancelOrder()
+    }*/
+    public function submitOrderNotify()
     {
     {
         try {
         try {
-            $params = $this->request->post(); // order_number
-            DouYinService::cancelOrder($params);
-            return $this->success();
+            $params = $this->request->post();
+            $msg = is_array($params['msg'])?$params['msg']:json_decode($params['msg'],true);
+            $msg['user_id'] = $this->userId;
+            $msg['user_info'] = $this->userInfo;
+            $res = DouYinService::submitOrderNotify($msg);
+            if($res){
+                return json(["err_no"=>0,"err_tips"=>"success","data"=>$res], 200);
+            }
         } catch (\Exception $e) {
         } catch (\Exception $e) {
-            return $this->fail($e->getMessage());
+            return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
         }
         }
     }
     }
+
     /**
     /**
      * 支付回调
      * 支付回调
      * @return \think\response\Json
      * @return \think\response\Json
@@ -213,7 +212,22 @@ class DouYinController extends BaseApiController
             return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
             return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
         }
         }
     }
     }
-
+    /**
+     * 取消订单
+     * @return \think\response\Json
+     * @author liugc <466014217@qq.com>
+     * @date 2025/5/22 14:35
+     */
+    public function cancelOrder()
+    {
+        try {
+            $params = $this->request->post(); // order_number
+            DouYinService::cancelOrder($params);
+            return $this->success();
+        } catch (\Exception $e) {
+            return $this->fail($e->getMessage());
+        }
+    }
     /**
     /**
      * 预约
      * 预约
      * @return \think\response\Json
      * @return \think\response\Json

+ 1 - 1
app/api/logic/GoodsLogic.php

@@ -61,7 +61,7 @@ class GoodsLogic extends BaseLogic
         if(!empty($goods)){
         if(!empty($goods)){
             $data = [];
             $data = [];
             foreach ($goods as $key => $value) {
             foreach ($goods as $key => $value) {
-                if($service_work_id > 0 || $platform_appid > 0){
+                if($service_work_id > 0 || $platform_appid > 0 || $platform_value > 0){
                     $value['service_fee'] = self::getPlatformServiceFee($platform_value,$value['id'])?:$value['service_fee'];
                     $value['service_fee'] = self::getPlatformServiceFee($platform_value,$value['id'])?:$value['service_fee'];
                 }
                 }
                 if($value['goods_payment_type'] == '2'){
                 if($value['goods_payment_type'] == '2'){

+ 235 - 45
app/api/service/DouYinService.php

@@ -9,7 +9,9 @@ use app\common\model\external\DouyinOrder;
 use app\common\model\external\DouyinRefundOrder;
 use app\common\model\external\DouyinRefundOrder;
 use app\common\model\external\ExternalConsultation;
 use app\common\model\external\ExternalConsultation;
 use app\common\model\external\ExternalConsultationOrder;
 use app\common\model\external\ExternalConsultationOrder;
+use app\common\model\external\ExternalPlatformGoods;
 use app\common\model\goods\Goods;
 use app\common\model\goods\Goods;
+use app\common\model\goods_category\GoodsCategory;
 use app\common\model\recharge\RechargeOrder;
 use app\common\model\recharge\RechargeOrder;
 use app\common\model\user\User;
 use app\common\model\user\User;
 use app\common\model\user\UserAuth;
 use app\common\model\user\UserAuth;
@@ -23,6 +25,8 @@ class DouYinService
 {
 {
     protected static int $terminal = \app\common\enum\user\UserTerminalEnum::DOUYIN;
     protected static int $terminal = \app\common\enum\user\UserTerminalEnum::DOUYIN;
     protected static int $external_platform_id = 6;
     protected static int $external_platform_id = 6;
+
+    // ********************************* 注册登录
     public static function register(array $params)
     public static function register(array $params)
     {
     {
         $userSn = User::createUserSn();
         $userSn = User::createUserSn();
@@ -77,9 +81,191 @@ class DouYinService
         }
         }
     }
     }
 
 
+    // **************************** 商品管理 goods_category_id goods_id external_platform_id
+
+    public static function addProduct($params)
+    {
+        $product_url = config('douyin.host').'goodlife/v1/goods/product/save/';
+        $res = http_request($product_url,self::getProductParams($params),['Content-Type' => 'application/json;charset=utf-8','access-token' => self::getClientToken()]);
+        Log::info('addProduct:'.json_encode($res));
+        // 记录到 extra 字段 productRes
+        $goods_id = $params['goods_id']??0;
+        $platformGoods = ExternalPlatformGoods::where('goods_id', $goods_id)->where('external_platform_id', $params['external_platform_id'])->findOrEmpty();
+        if(!$platformGoods->isEmpty()){
+            $extra = $platformGoods->extra?json_decode($platformGoods->extra,true):[];
+            $extra['productRes'] = json_encode($res);
+            $platformGoods->extra = json_encode($extra);
+            $platformGoods->save();
+        }
+        self::addSku($params);
+        return [];
+    }
+
+    public static function addSku($params)
+    {
+        $sku_url = config('douyin.host').'goodlife/v1/goods/sku/batch_save/';
+        $res = http_request($sku_url,self::getSkuParams($params),['Content-Type' => 'application/json;charset=utf-8','access-token' => self::getClientToken()]);
+        Log::info('addSku:'.json_encode($res));
+        // 根据返回后更新本地库对应关系 $res['data']['sku_id_list']
+        if(isset($res['data']['sku_id_list']) && !empty($res['data']['sku_id_list'])){
+            foreach ($res['data']['sku_id_list'] as $item) {
+                ExternalPlatformGoods::where('goods_id', $item['out_sku_id'])->where('external_platform_id', $params['external_platform_id'])->update([
+                    'external_goods_sn' => $item['sku_id']
+                ]);
+            }
+        }
+        return [];
+    }
+
+    public static function getProductParams($params)
+    {
+        $goodsCategory = GoodsCategory::where('id',$params['goods_category_id']??0)->findOrEmpty();
+        if($goodsCategory->isEmpty()){
+            return [];
+        }
+        $goodsCategory = $goodsCategory->toArray();
+        return [
+            "account_id" => '7511543640776017961',
+            "product" => [
+                "out_id" => $params['goods_category_id']??0,
+                "product_name" => $goodsCategory['name'],
+                "product_type" => 22,
+                "category_id" => 6004003,
+                "category_full_name" =>  "其他维修服务",
+                "biz_line" =>  5,
+                "account_name" =>  "亿蜂快修·武汉市",
+                //{\"params\":\"{\"spuId\":\"xxxxx\",\"skuId\":\"xxxxxx\"}\",\"path\":\"pages/any/path\",\"app_id\":\"xxxxx\"}
+                "out_url" => json_encode(['app_id'=>config('douyin.appId'),'path'=>'pages/detail','params'=>json_encode(['goods_category_id'=>$params['goods_category_id']??0])]),
+                "pois" =>[
+                    [
+                        "poi_id" => "7511543640776017961"
+                    ]
+                ],
+                "product_ext" => [
+                    "auto_online" => true,
+                    "display_price"=> ["low_price" => 30,"high_price" => 300],
+                    "test_extra"=> ["test_flag" => true,"uids" => ["1548********2888"]]
+                ],
+                "attr_key_value_map" => self::getAttrKeyValueMapParams('product',$goodsCategory),
+                "sold_end_time" => time() + 180 * 86400,
+                "sold_start_time" => time()
+            ]
+        ];
+    }
+    public static function getSkuParams($params)
+    {
+        $goods = Goods::where('id',$params['goods_id']??0)->findOrEmpty();
+        if ($goods->isEmpty()) {
+            return [];
+        }
+        $goods = $goods->toArray();
+        // 查询商品信息
+        return [
+            "account_id" => '7511543640776017961',
+            "product_out_id" => $params['goods_category_id']??0,
+            "sku" => [
+                [
+                    "out_sku_id"=> $goods['id'],
+                    "sku_name"=> $goods['name'],
+                    "origin_amount"=> $goods['service_total'] * 100,
+                    "actual_amount"=> $goods['service_fee'] * 100,
+                    "stock"=> [
+                        "limit_type"=> 2,
+                        "stock_qty"=> 9999
+                    ],
+                    "status"=> 1,
+                    "attr_key_value_map"=> self::getAttrKeyValueMapParams('sku',$goods)
+                ]
+            ]
+        ];
+    }
+
+
+    public static function getAttrKeyValueMapParams($type,$params)
+    {
+        $res = [];
+        if($type === 'product'){
+            $res = [
+                "appointment"=>json_encode([
+                            "need_appointment"=>true,
+                            "ahead_time_type"=>2,
+                            "ahead_hour_num"=> 5,
+                            "external_link"=>"pages/detail",
+                            "order_appointment_time_url"=>"pages/order"
+                ]),
+                "auto_renew"=>true,
+                "can_no_use_date" => json_encode(["enable"=>false]),
+                "Description" => json_encode([]),
+                "image_list" => json_encode([["url"=>$params['picture']??'']]),
+                "limit_use_rule" => json_encode(["is_limit_use"=>true, "use_num_per_consume"=>1]),
+                "Notification" => json_encode([["title"=>$params['name']??'',"content"=>$params['name']??'']]),
+                "RefundPolicy"=> "2",
+                "refund_need_merchant_confirm"=> true,
+                "show_channel"=> 1,
+                "superimposed_discounts"=> false,
+                "trade_url"=> json_encode(['app_id'=>config('douyin.appId'),'path'=>'pages/detail','params'=>json_encode(['goods_category_id'=>$params['id']??0])]),
+                "use_date"=> json_encode(["use_date_type"=>2, "day_duration"=>15]),
+                "use_time"=> json_encode(["use_time_type"=>1]),
+                //"user_num_limit"=> ,
+                "code_source_type"=> 3,
+                "settle_type"=> 1,
+                "use_type"=> 1,
+                "limit_rule"=> json_encode(["is_limit"=>false]),
+                "out_id"=> $params['id']??0
+            ];
+        }
+        if($type === 'sku'){
+            $res = [
+                "code_source_type"=> 3,
+                "limit_rule"=> json_encode(["is_limit"=>false]),
+                "settle_type"=> 1
+            ];
+        }
+        return $res;
+    }
+
+
+    // ******************************** 订单
+
+    /**
+     * 扩展点回调提交订单
+     * @param $params
+     * @throws \Exception
+     * @author liugc <466014217@qq.com>
+     * @date 2025/6/4 14:03
+     */
+    public static function submitOrderNotify($params)
+    {
+        try {
+            // order_id goods  total_amount discount cp_extra create_order_time phone_num contact_name open_id
+            if(empty($params['user_info']['mobile'])){
+                throw new \Exception('手机号不能为空!');
+            }
+            // goods_id  user_info.mobile  user_id quantity
+            $order_number = self::submitOrder([
+                'goods_id'=>$params['goods'][0]['goods_id'],
+                'user_id'=>$params['user_id'],
+                'user_info'=>$params['user_info'],
+                'quantity'=>$params['goods'][0]['quantity']
+            ]);
+            return [
+                "outOrderNo" => $order_number,
+                "orderEntrySchema" => [
+                    "path" => "page/index/index",
+                    "params" => json_encode(['order_number' => $order_number])
+                ],
+                "payNotifyUrl" => config('douyin.payNotifyUrl')
+            ];
+        } catch (\Exception $e) {
+            throw new \Exception($e->getMessage());
+        }
+    }
+
+
+
     /**
     /**
      * 提交订单
      * 提交订单
-     * @param array $params
+     * @param array $params goods_id  user_info.mobile  user_id quantity
      * @return array|false
      * @return array|false
      */
      */
     public static function submitOrder($params)
     public static function submitOrder($params)
@@ -420,7 +606,48 @@ class DouYinService
             throw new \Exception($e->getMessage());
             throw new \Exception($e->getMessage());
         }
         }
     }
     }
+    public static function sendRefundCreate($order_number)
+    {
+        try {
+            // $params['order_number']
+            $order = DouyinOrder::with(['goods','serviceWork'])->where('order_number', $order_number)->findOrEmpty();
+            if($order->isEmpty()){
+                throw new \Exception('订单不存在');
+            }
+            $orderInfo = $order->toArray();
+            $douyinRefundOrder = DouyinRefundOrder::where('order_number', $order_number)->order('id', 'desc')->findOrEmpty();
 
 
+            //通过后向抖音申请退款
+            //getClientToken()
+            $url = config('douyin.host').'api/trade_basic/v1/developer/refund_create/';
+            $data = [
+                "order_id" => $orderInfo['transaction_id'],
+                "out_refund_no" => $douyinRefundOrder->refund_number,
+                "cp_extra" => $orderInfo['id'].'|'.$douyinRefundOrder->id,
+                "order_entry_schema" => [
+                    "path" => "page/index/index",
+                    "params" => json_encode(['refund_number'=>$douyinRefundOrder->refund_number])
+                ],
+                "refund_total_amount " => $douyinRefundOrder->refund_amount * 100,
+                "notify_url" => config('douyin.refundNotifyUrl'),
+                "refund_reason" => [
+                    [
+                        "code" => 101,
+                        "text" => "不想要了"
+                    ]
+                ]
+            ];
+            $res = http_request($url,$data,['Content-Type' => 'application/json;charset=utf-8','access_token' => self::getClientToken()]);
+            if(isset($res['err_msg']) && $res['err_msg'] === 'success'){
+                $douyinRefundOrder->transaction_id = $res['data']['refund_id'];
+                $douyinRefundOrder->save();
+            }
+            return true;
+        } catch (\Exception $e) {
+            Log::info($e->getMessage());
+            return false;
+        }
+    }
     public static function refundNotify($params)
     public static function refundNotify($params)
     {
     {
         Db::startTrans();
         Db::startTrans();
@@ -452,6 +679,9 @@ class DouYinService
     }
     }
 
 
 
 
+
+
+
     public static function byteAuthorization($privateKeyStr, $data, $appId, $nonceStr, $timestamp, $keyVersion) {
     public static function byteAuthorization($privateKeyStr, $data, $appId, $nonceStr, $timestamp, $keyVersion) {
         $byteAuthorization = '';
         $byteAuthorization = '';
         // 读取私钥
         // 读取私钥
@@ -485,67 +715,27 @@ class DouYinService
         }
         }
         return $str;
         return $str;
     }
     }
-    public static function getClientToken() {
+    public static function getClientToken($isRefresh = false) {
         $url = config('douyin.host').'oauth/client_token/';
         $url = config('douyin.host').'oauth/client_token/';
         $cache_name = 'dy_client_token';
         $cache_name = 'dy_client_token';
         $cache_data = cache($cache_name);
         $cache_data = cache($cache_name);
-        if(empty($cache_data) || $cache_data == null){
+        if(empty($cache_data) || $cache_data == null || $isRefresh){
             $data = [
             $data = [
                 'client_key'=> config('douyin.appId'),
                 'client_key'=> config('douyin.appId'),
                 'client_secret'=> config('douyin.appSecret'),
                 'client_secret'=> config('douyin.appSecret'),
                 'grant_type'=> "client_credential"
                 'grant_type'=> "client_credential"
             ];
             ];
             $res = http_request($url,$data,['Content-Type' => 'application/json;charset=utf-8']);
             $res = http_request($url,$data,['Content-Type' => 'application/json;charset=utf-8']);
+            Log::info(json_encode($res));
             if($res['message'] === 'success'){
             if($res['message'] === 'success'){
                 cache($cache_name, json_encode($res['data']), (time()+$res['data']['expires_in']-1));
                 cache($cache_name, json_encode($res['data']), (time()+$res['data']['expires_in']-1));
                 $cache_data = $res['data'];
                 $cache_data = $res['data'];
             }
             }
         }
         }
-        return json_decode($cache_data, true)['access_token'];
+        return $cache_data['access_token'];
     }
     }
 
 
-    public static function sendRefundCreate($order_number)
-    {
-        try {
-            // $params['order_number']
-            $order = DouyinOrder::with(['goods','serviceWork'])->where('order_number', $order_number)->findOrEmpty();
-            if($order->isEmpty()){
-                throw new \Exception('订单不存在');
-            }
-            $orderInfo = $order->toArray();
-            $douyinRefundOrder = DouyinRefundOrder::where('order_number', $order_number)->order('id', 'desc')->findOrEmpty();
 
 
-                //通过后向抖音申请退款
-                //getClientToken()
-                $url = config('douyin.host').'api/trade_basic/v1/developer/refund_create/';
-                $data = [
-                    "order_id" => $orderInfo['transaction_id'],
-                    "out_refund_no" => $douyinRefundOrder->refund_number,
-                    "cp_extra" => $orderInfo['id'].'|'.$douyinRefundOrder->id,
-                    "order_entry_schema" => [
-                        "path" => "page/index/index",
-                        "params" => json_encode(['refund_number'=>$douyinRefundOrder->refund_number])
-                    ],
-                    "refund_total_amount " => $douyinRefundOrder->refund_amount * 100,
-                    "notify_url" => config('douyin.refundNotifyUrl'),
-                    "refund_reason" => [
-                        [
-                            "code" => 101,
-                            "text" => "不想要了"
-                        ]
-                    ]
-                ];
-                $res = http_request($url,$data,['Content-Type' => 'application/json;charset=utf-8','access_token' => self::getClientToken()]);
-                if(isset($res['err_msg']) && $res['err_msg'] === 'success'){
-                    $douyinRefundOrder->transaction_id = $res['data']['refund_id'];
-                    $douyinRefundOrder->save();
-                }
-            return true;
-        } catch (\Exception $e) {
-            Log::info($e->getMessage());
-            return false;
-        }
-    }
 
 
 
 
 }
 }

+ 7 - 1
app/common/model/external/ExternalPlatform.php

@@ -26,5 +26,11 @@ class ExternalPlatform extends BaseModel
     }
     }
 
 
 
 
-
+    public static function getPlatformConfig($platform_id,$config_value=null){
+        $config_data = json_decode(ExternalPlatform::where('id', $platform_id)->value('config_data')??[],  true);
+        if(empty($config_value)){
+            return $config_data;
+        }
+        return $config_data[$config_value]??'';
+    }
 }
 }

+ 1 - 1
config/cache.php

@@ -29,7 +29,7 @@ return [
             // 驱动方式
             // 驱动方式
             'type'   => 'redis',
             'type'   => 'redis',
             // 服务器地址
             // 服务器地址
-            'host'   => env('cache.host','like-redis'),
+            'host'   => env('cache.host','127.0.0.1'),
             // 端口
             // 端口
             'port'   => env('cache.port','6379'),
             'port'   => env('cache.port','6379'),
             // 密码
             // 密码