Commit 57b0b65a by 宁成龙

Merge remote-tracking branch 'origin/master'

parents 6ace6d0c ecfb1977
...@@ -148,7 +148,6 @@ class OrderApiController extends BaseController ...@@ -148,7 +148,6 @@ class OrderApiController extends BaseController
$err_msg = ValidatorMsg::getMsg($errors); $err_msg = ValidatorMsg::getMsg($errors);
throw new InvalidRequestException($err_msg); throw new InvalidRequestException($err_msg);
} }
OrderService::editOrderItems($order_id,$orderItems,$order_remark); OrderService::editOrderItems($order_id,$orderItems,$order_remark);
return $this->setSuccess(); return $this->setSuccess();
} }
...@@ -190,19 +189,9 @@ class OrderApiController extends BaseController ...@@ -190,19 +189,9 @@ class OrderApiController extends BaseController
//修改订单结算信息 //修改订单结算信息
public function editOrderSettlement(Request $request){ public function editOrderSettlement(Request $request){
$reqParams = $request->all(); $reqParams = $request->all();
$validator = Validator::make($reqParams, [ OrderService::editOrderSettlement($reqParams);
'order_id' => 'required',
'order_address_type' => 'required',
], [
'order_id.required' => admin_trans("order.validator.order_id_required"),
'order_address_type.required' => admin_trans("order.validator.order_address.required"),
], []);
if ($validator->fails()) {
$errors = $validator->errors()->toArray();
$err_msg = ValidatorMsg::getMsg($errors);
throw new InvalidRequestException($err_msg);
}
} }
} }
...@@ -127,13 +127,22 @@ class OrderService extends BaseService ...@@ -127,13 +127,22 @@ class OrderService extends BaseService
"return_price"=>$orderItem["return_goods_price"], "return_price"=>$orderItem["return_goods_price"],
"return_amount"=> decimal_number_format($orderItem["return_goods_number"] * $orderItem["return_goods_price"]), "return_amount"=> decimal_number_format($orderItem["return_goods_number"] * $orderItem["return_goods_price"]),
]; ];
$createOrEdit = false; $createOrEdit = false;
if(!empty($returnItems)){ if(!empty($returnItems)){
foreach($insertReturnItemData as $field=>$val){ foreach($insertReturnItemData as $field=>$val){
if(!in_array($val["type"],[1,2]) || !$val["return_goods_number"] || !$val["return_goods_price"]){ if($field == "type" && !in_array($val["type"],[1,2])){
continue; continue;
} }
if($field == "return_goods_number" && !$val){
continue;
}
if($field == "return_goods_price" && !$val){
continue;
}
if(empty($returnItems[$field]) || $returnItems[$field] != $val){ if(empty($returnItems[$field]) || $returnItems[$field] != $val){
$createOrEdit = true;//新增 $createOrEdit = true;//新增
break; break;
...@@ -247,4 +256,14 @@ class OrderService extends BaseService ...@@ -247,4 +256,14 @@ class OrderService extends BaseService
return decimal_number_format($returnAmount); return decimal_number_format($returnAmount);
} }
public static function editOrderSettlement($reqParams){
$orderId = arrayGet($reqParams,"order_id",0,"intval");
$freightCharge = arrayGet($reqParams,"freight_charge",0,"floatval");//运费
$payCommission = arrayGet($reqParams,"pay_commission",0,"floatval");//支付手续费
$orderUserPayType = arrayGet($reqParams,"order_user_pay_type",0,"intval");//支付方式
}
} }
...@@ -22,16 +22,12 @@ Route::group([ ...@@ -22,16 +22,12 @@ Route::group([
$router->resource('test', 'TestController'); $router->resource('test', 'TestController');
$router->resource('users', 'UserController'); $router->resource('users', 'UserController');
$router->resource('country', 'CountryController'); $router->resource('country', 'CountryController');
//下载pdf
Route::get('/api/order_download', '\App\Admin\Controllers\Api\OrderApiController@orderDownload');//下载订单pdf
Route::get('/api/test', '\App\Admin\Controllers\Api\TestController@index');
Route::get('/api/orderList', '\App\Admin\Controllers\Api\OrderApiController@orderList');//订单详情获取明细数据
Route::get('/api/orderDownloadShow', '\App\Admin\Controllers\Api\OrderApiController@orderDownloadShow');//订单下载
Route::match(['get', 'post'],'/api/order/editOrderItems', '\App\Admin\Controllers\Api\OrderApiController@editOrderItems');//订单修改明细数据
Route::match(['get', 'post'],'/api/order/editOrderAdress', '\App\Admin\Controllers\Api\OrderApiController@editOrderAdress');//修改订单收货地址账单地址
Route::match(['get', 'post'],'/api/order/editOrderSettlement', '\App\Admin\Controllers\Api\OrderApiController@editOrderSettlement');//修改订单结算信息
}); });
...@@ -39,7 +39,7 @@ class Kernel extends HttpKernel ...@@ -39,7 +39,7 @@ class Kernel extends HttpKernel
\Illuminate\Session\Middleware\StartSession::class, \Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class, // \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class,
// \App\Http\Middleware\VerifyCsrfToken::class, \App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class, \Illuminate\Routing\Middleware\SubstituteBindings::class,
], ],
......
...@@ -25,7 +25,28 @@ return [ ...@@ -25,7 +25,28 @@ return [
], ],
"return_msg"=>[ "return_msg"=>[
"50000"=>"操作成功", "50000"=>"操作成功",
"50001"=>"只能修改不是待审核的订单状态" "50001"=>"只能修改不是待审核的订单状态",
"50002"=>"取消订单失败",
"50003"=>"修改订单失败",
],
"validator"=>[
'order_id_required' => '订单id必填',
'order_items_required' => '订单明细数据错误',
'goods_price' => [
"gt"=>"商品单价不能小于0"
],
'goods_number' => [
"gt"=>"商品数量不能小于0"
],
'return_goods_price' => [
"gt"=>"售后单价不能小于0"
],
'return_goods_number' => [
"gt"=>"售后数量不能小于0"
],
'order_address_type' => [
"required"=>"订单地址类型是必须的"
],
], ],
'options' => [ 'options' => [
"status"=>[ "status"=>[
......
...@@ -19,5 +19,15 @@ Route::middleware('auth:api')->get('/user', function (Request $request) { ...@@ -19,5 +19,15 @@ Route::middleware('auth:api')->get('/user', function (Request $request) {
}); });
//下载pdf
Route::get('/order_download', '\App\Admin\Controllers\Api\OrderApiController@orderDownload');//下载订单pdf
Route::get('/test', '\App\Admin\Controllers\Api\TestController@index');
Route::get('/orderList', '\App\Admin\Controllers\Api\OrderApiController@orderList');//订单详情获取明细数据
Route::get('/orderDownloadShow', '\App\Admin\Controllers\Api\OrderApiController@orderDownloadShow');//订单下载
Route::match(['get', 'post'],'/order/editOrderItems', '\App\Admin\Controllers\Api\OrderApiController@editOrderItems');//订单修改明细数据
Route::match(['get', 'post'],'/order/editOrderAdress', '\App\Admin\Controllers\Api\OrderApiController@editOrderAdress');//修改订单收货地址账单地址
Route::match(['get', 'post'],'/order/editOrderSettlement', '\App\Admin\Controllers\Api\OrderApiController@editOrderSettlement');//修改订单结算信息
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment