Commit ff758472 by 孙龙

订单bug修改

parent 08872ccb
......@@ -53,7 +53,7 @@ class OrderController extends AdminController
$user = request()->user;
// dump(PermService::getUserPerms());
return Grid::make(new Order(), function (Grid $grid) {
$grid->model()->rule(Order::$ruleViewList)->with("scmUser")->orderBy('order_id', 'desc');
$grid->model()->rule(Order::$ruleViewList)->with("scmUser")->with("order_price")->orderBy('order_id', 'desc');
$grid->fixColumns(1,2);//固定列
// $grid->showColumnSelector();//开启字段选择器功能
// 在 display 回调中使用
......@@ -73,7 +73,22 @@ class OrderController extends AdminController
});
$grid->column('scmUser.name',admin_trans('scm-user.fields.name'));
$grid->column('order_amount')->help('订单详情里-结算信息的“运费”“支付手续费”“其他费用”为空时;应付金额一栏为“待确认”');
$grid->column('order_price',"应付金额")->display(function ($order_price) {
$otherAmount = 0;
foreach($order_price->toArray() as $key=>$val ){
if(in_array($val["price_type"],[3,5])){
$otherAmount += $val["price"];
}
}
if($otherAmount == 0){
return "待确认";
}else{
return decimal_number_format_usd($otherAmount+$otherAmount);
}
});
$grid->column('order_pay_type')->using(admin_trans('order.options.order_pay_type'))->sortable();
$grid->column('order_user_pay_type',admin_trans("order.fields.order_user_pay_type"))->display(function () {
return Arr::get(admin_trans("order.options.order_user_pay_type"),$this->order_user_pay_type,"");
......
......@@ -102,6 +102,7 @@ class Order extends BaseModel
return $orderInfo ? $orderInfo->toArray() : [];
}
//取消
public static function canelOrder($orderId=0){
return self::where("order_id",$orderId)->update([
......
......@@ -10,6 +10,7 @@ return [
'是否确认审核' => 'Do you confirm the audit',
'审核成功' => 'Successful audit',
'是否确认反审核' => 'Whether to confirm counteraudit',
'待确认' => 'To be confirmed',
],
'fields' => [
......
......@@ -10,6 +10,7 @@ return [
'是否确认审核' => '是否确认审核',
'审核成功' => '是否确认审核',
'是否确认反审核' => '是否确认审核',
'待确认' => '待确认',
],
'fields' => [
......
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