Browse Source

Merge branch 'v5.1.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.1.0dev

From-wh 2 years atrás
parent
commit
4faba1a1b9

+ 21 - 0
crmeb/app/adminapi/controller/v1/order/StoreOrder.php

@@ -309,6 +309,27 @@ class StoreOrder extends AuthController
         return app('json')->success(100010);
     }
 
+    /**
+     * 获取寄件预扣金额
+     * @param ServeServices $services
+     * @return \think\Response
+     * @author 等风来
+     * @email 136327134@qq.com
+     * @date 2023/6/16
+     */
+    public function getPrice(ServeServices $services)
+    {
+        $data = $this->request->postMore([
+            ['kuaidicom', ''],
+            ['send_address', ''],
+            ['address', ''],
+            ['weight', ''],
+            ['service_type', ''],
+        ]);
+
+        return app('json')->success($services->express()->getPrice($data));
+    }
+
     /**
      * 获取订单可拆分发货商品列表
      * @param $id

+ 1 - 9
crmeb/app/adminapi/controller/v1/setting/SystemStorage.php

@@ -79,19 +79,11 @@ class SystemStorage extends AuthController
     }
 
     /**
-     * @param SystemConfigServices $services
      * @return mixed
      */
-    public function saveConfig(SystemConfigServices $services)
+    public function saveConfig( )
     {
         $type = (int)$this->request->post('type', 0);
-//        $services->update('upload_type', ['value' => json_encode($type)], 'menu_name');
-//        if (1 === $type) {
-//            $this->services->transaction(function () {
-//                $this->services->update(['status' => 1, 'is_delete' => 0], ['status' => 0]);
-//            });
-//        }
-//        \crmeb\services\CacheService::clear();
 
         $data = $this->request->postMore([
             ['accessKey', ''],

+ 2 - 0
crmeb/app/adminapi/route/order.php

@@ -36,6 +36,8 @@ Route::group('order', function () {
     Route::put('take/:id', 'v1.order.StoreOrder/take_delivery')->name('StoreOrderTakeDelivery')->option(['real_name' => '确认收货']);
     //发送货
     Route::put('delivery/:id', 'v1.order.StoreOrder/update_delivery')->name('StoreOrderUpdateDelivery')->option(['real_name' => '订单发送货']);
+    //获取商家寄件金额
+    Route::post('price', 'v1.order.StoreOrder/getPrice')->name('getPrice')->option(['real_name' => '获取商家寄件金额']);
     //获取订单可拆分商品列表
     Route::get('split_cart_info/:id', 'v1.order.StoreOrder/split_cart_info')->name('StoreOrderSplitCartInfo')->option(['real_name' => '获取订单可拆分商品列表']);
     //拆单发送货

+ 1 - 1
crmeb/app/services/product/product/CopyTaobaoServices.php

@@ -55,7 +55,7 @@ class CopyTaobaoServices extends BaseServices
             case 1://平台
                 /** @var ServeServices $services */
                 $services = app()->make(ServeServices::class);
-                $resultData = $services->copy('copy')->goods($url, sys_config('yihaotong_copy_appid', ''));
+                $resultData = $services->copy('copy')->goods($url, [], sys_config('yihaotong_copy_appid', ''));
                 if (isset($resultData['description_image']) && is_string($resultData['description_image'])) {
                     $resultData['description_image'] = json_decode($resultData['description_image'], true);
                 }

+ 3 - 1
crmeb/app/services/product/product/StoreProductServices.php

@@ -871,7 +871,8 @@ class StoreProductServices extends BaseServices
                     'image' => $items['pic'],
                     'price' => $items['price'],
                     'ot_price' => $items['ot_price'],
-                    'suk' => implode(',', $items['detail'])
+                    'suk' => implode(',', $items['detail']),
+                    'unique' => $items['unique'],
                 ];
             }
         }
@@ -951,6 +952,7 @@ class StoreProductServices extends BaseServices
             $valueNew[$count]['stock'] = intval($sukValue[$suk]['stock']);
             $valueNew[$count]['quota'] = intval($sukValue[$suk]['quota']);
             $valueNew[$count]['bar_code'] = $sukValue[$suk]['bar_code'];
+            $valueNew[$count]['unique'] = $sukValue[$suk]['unique'];
             $valueNew[$count]['weight'] = $sukValue[$suk]['weight'] ? floatval($sukValue[$suk]['weight']) : 0;
             $valueNew[$count]['volume'] = $sukValue[$suk]['volume'] ? floatval($sukValue[$suk]['volume']) : 0;
             $valueNew[$count]['brokerage'] = $sukValue[$suk]['brokerage'] ? floatval($sukValue[$suk]['brokerage']) : 0;

+ 1 - 1
crmeb/app/services/product/sku/StoreProductAttrValueServices.php

@@ -91,7 +91,7 @@ class StoreProductAttrValueServices extends BaseServices
      */
     public function getSkuArray(array $where)
     {
-        return $this->dao->getColumn($where, 'bar_code,cost,price,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,quota', 'suk');
+        return $this->dao->getColumn($where, 'bar_code,cost,price,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,quota,unique', 'suk');
     }
 
     /**

+ 0 - 4
crmeb/app/services/system/SystemCrudServices.php

@@ -545,10 +545,6 @@ class SystemCrudServices extends BaseServices
             }
         }
 
-        //读取字段
-        //读取数据库字段信息
-        $tableInfo = $this->getTableInfo($tableName);
-
         //获取主键
         foreach ($tableField as $value) {
             if ($value['primaryKey']) {

+ 12 - 6
crmeb/app/services/user/UserBrokerageServices.php

@@ -405,13 +405,19 @@ class UserBrokerageServices extends BaseServices
                 $item['time'] = $item['time_key'] = $item['add_time'] ? date('Y-m', (int)$item['add_time']) : '';
                 $item['add_time'] = $item['add_time'] ? date('Y-m-d H:i', (int)$item['add_time']) : '';
                 $item['fail_msg'] = $item['type'] == 'extract_fail' ? $userExtract[$item['link_id']]['fail_msg'] : '';
-                $extract_type = $userExtract[$item['link_id']]['extract_type'];
-                if ($extract_type == 'alipay') {
-                    $item['extract_type'] = '支付宝';
-                } elseif ($extract_type == 'weixin') {
-                    $item['extract_type'] = '微信';
+                if ($type == 4) {
+                    $extract_type = $userExtract[$item['link_id']]['extract_type'] ?? '';
+                    if ($extract_type == 'alipay') {
+                        $item['extract_type'] = '支付宝';
+                    } elseif ($extract_type == 'weixin') {
+                        $item['extract_type'] = '微信';
+                    } elseif ($extract_type == 'bank') {
+                        $item['extract_type'] = '银行卡';
+                    } else {
+                        $item['extract_type'] = '其他';
+                    }
                 } else {
-                    $item['extract_type'] = '银行卡';
+                    $item['extract_type'] = '';
                 }
             }
             $times = array_merge(array_unique(array_column($list, 'time_key')));

+ 33 - 1
crmeb/crmeb/services/express/storage/Express.php

@@ -12,6 +12,7 @@
 namespace crmeb\services\express\storage;
 
 use app\services\shipping\ExpressServices;
+use crmeb\exceptions\ApiException;
 use crmeb\services\express\BaseExpress;
 use crmeb\exceptions\AdminException;
 
@@ -54,6 +55,8 @@ class Express extends BaseExpress
     const SHIPMENT_CANCEL_ORDER = 'v2/shipment/cancel_order';
     //获取商家寄件订单列表
     const SHIPMENT_INDEX = 'v2/shipment/index';
+    //获取商家寄件订单预扣金额
+    const SHIPMENT_PRICE = 'v2/shipment/price';
 
     /** 初始化
      * @param array $config
@@ -158,6 +161,35 @@ class Express extends BaseExpress
         return $this->accessToken->httpRequest(self::SHIPMENT_INDEX, $param, 'GET');
     }
 
+    /**
+     * @param array $data
+     * @return array|mixed
+     * @author 等风来
+     * @email 136327134@qq.com
+     * @date 2023/6/16
+     */
+    public function getPrice(array $data)
+    {
+        if (!empty($data['kuaidicom'])) {
+            throw new ApiException('快递编码必须填写');
+        }
+        if (!empty($data['send_address'])) {
+            throw new ApiException('寄件地址必须填写');
+        }
+        if (!empty($data['address'])) {
+            throw new ApiException('收件地址必须填写');
+        }
+        $param = [
+            'kuaidi_num' => $data['kuaidicom'],
+            'send_address' => $data['send_address'],
+            'address' => $data['address'] ?? '',
+            'weight' => $data['weight'] ?? '',
+            'service_type' => $data['service_type'] ?? '',
+        ];
+
+        return $this->accessToken->httpRequest(self::SHIPMENT_PRICE, $param);
+    }
+
     /**
      * 开通物流服务
      * @return bool|mixed
@@ -184,7 +216,7 @@ class Express extends BaseExpress
         if (!sys_config('config_export_siid')) {
             $header = ['version:v1.1'];
         }
-        return $this->accessToken->httpRequest(self::EXPRESS_TEMP, $param, 'POST', true, $header);
+        return $this->accessToken->httpRequest(self::EXPRESS_TEMP, $param, 'GET', true, $header);
     }
 
     /**

+ 1 - 0
crmeb/crmeb/services/upload/storage/Obs.php

@@ -215,6 +215,7 @@ class Obs extends BaseUpload
         return [];
     }
 
+
     public function bindDomian(string $name, string $domain, string $region = null)
     {
         $parseDomin = parse_url($domain);