|
|
@@ -4,7 +4,6 @@
|
|
|
namespace App\Http\Controllers\api\thirdPart\hengli;
|
|
|
|
|
|
use App\Http\Controllers\api\thirdPart\weight\WeightBaseController;
|
|
|
-use App\Log;
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
class PackageController extends WeightBaseController
|
|
|
@@ -83,4 +82,24 @@ class PackageController extends WeightBaseController
|
|
|
return json_encode(['success'=>false,'message'=> $e->getMessage],JSON_UNESCAPED_UNICODE);
|
|
|
}
|
|
|
|
|
|
+ public function validator(Request $request): array
|
|
|
+ {
|
|
|
+ $params = $this->conversionRequest($request);
|
|
|
+ $errors = [];
|
|
|
+ $weight = $this->getWeightValue($params);
|
|
|
+ if(empty($weight) || $weight == ''){
|
|
|
+ $errors['weight'] = '称重重量为空';
|
|
|
+ }
|
|
|
+ $code = $this->getCodeValue($params);
|
|
|
+ $code = trim($code,"'");
|
|
|
+ if(empty($code) || $code == ''){
|
|
|
+ $errors['code'] = '快递单号为空';
|
|
|
+ }
|
|
|
+ $hid = $this->getValue($this->hid, $params);
|
|
|
+ if(empty($hid) || $hid == ''){
|
|
|
+ $errors['hid'] = '称重设备号不能为空';
|
|
|
+ }
|
|
|
+ return $errors;
|
|
|
+ }
|
|
|
+
|
|
|
}
|