فهرست منبع

修改 service 属性为public

ajun 5 سال پیش
والد
کامیت
a62aa4e912

+ 7 - 7
app/Services/weight/GoodScanWeightService.php

@@ -5,13 +5,13 @@ namespace App\Services\weight;
 
 class GoodScanWeightService extends WeightService
 {
-    protected $weight = 'weight';       // 重量
-    protected $length = 'l';            // 长
-    protected $width = 'w';             // 宽
-    protected $height = 'h';            // 高
-    protected $code = 'code';           // 快递单号
-    protected $weight_at = 'weight_at'; // 称重时间
-    protected $hid = 'hid';             // 称重设备id
+    public $weight = 'weight';       // 重量
+    public $length = 'l';            // 长
+    public $width = 'w';             // 宽
+    public $height = 'h';            // 高
+    public $code = 'code';           // 快递单号
+    public $weight_at = 'time'; // 称重时间
+    public $hid = 'hid';             // 称重设备id
     public $name = 'GoodScan';          // 名称
 
     public function getSuccessMessage($params, $orderPackage): array

+ 7 - 7
app/Services/weight/HaoChuangWeightService.php

@@ -7,13 +7,13 @@ use Illuminate\Support\Carbon;
 
 class HaoChuangWeightService extends WeightService
 {
-    protected $weight = 'weight';     // 重量
-    protected $length = 'length';     // 长
-    protected $width = 'width';      // 宽
-    protected $height = 'height';     // 高
-    protected $code = 'barcode';       // 快递单号
-    protected $weight_at = 'weight_at';  // 称重时间
-    protected $hid = 'id';        // 称重设备id
+    public $weight = 'weight';     // 重量
+    public $length = 'length';     // 长
+    public $width = 'width';      // 宽
+    public $height = 'height';     // 高
+    public $code = 'barcode';       // 快递单号
+    public $weight_at = 'weight_at';  // 称重时间
+    public $hid = 'id';        // 称重设备id
     public $name = 'HaoChuang';       // 名称
 
     public function getSuccessMessage($params, $orderPackage): array

+ 7 - 7
app/Services/weight/HengLiWeightService.php

@@ -7,13 +7,13 @@ namespace App\Services\weight;
 class HengLiWeightService extends WeightService
 {
     // 参数
-    protected $weight = 'weight';     // 重量
-    protected $length = 'length';     // 长
-    protected $width = 'width';      // 宽
-    protected $height = 'height';     // 高
-    protected $code = 'code';       // 快递单号
-    protected $weight_at = 'weight_at';  // 称重时间
-    protected $hid = 'hid';        // 称重设备id
+    public $weight = 'weight';     // 重量
+    public $length = 'length';     // 长
+    public $width = 'width';      // 宽
+    public $height = 'height';     // 高
+    public $code = 'code';       // 快递单号
+    public $weight_at = 'weight_at';  // 称重时间
+    public $hid = 'hid';        // 称重设备id
     public $name = 'HengLi';       // 名称
 
     public function getWeightValue($params)

+ 8 - 9
app/Services/weight/WeightService.php

@@ -18,13 +18,13 @@ use Illuminate\Support\Carbon;
 
 class WeightService
 {
-    protected $weight = '';     // 重量
-    protected $length = '';     // 长
-    protected $width = '';      // 宽
-    protected $height = '';     // 高
-    protected $code = '';       // 快递单号
-    protected $weight_at = '';  // 称重时间
-    protected $hid = '';        // 称重设备id
+    public $weight = '';     // 重量
+    public $length = '';     // 长
+    public $width = '';      // 宽
+    public $height = '';     // 高
+    public $code = '';       // 快递单号
+    public $weight_at = '';  // 称重时间
+    public $hid = '';        // 称重设备id
     public $name = '';       // 名称
 
     public function new(array $params): array
@@ -92,8 +92,7 @@ class WeightService
             return $this->getWeightMessage($orderPackage, $e);
         }
 
-        $result = $this->getSuccessMessage($params, $orderPackage);
-        return $result;
+        return $this->getSuccessMessage($params, $orderPackage);
     }