作者 何书鹏

bug修改

... ... @@ -70,6 +70,8 @@ class Litestoreorder extends Backend
$row->visible(['id','order_no','total_price','pay_price','pay_time','express_price','freight_time','receipt_time','order_status','updatetime']);
$row->visible(['address']);
$row->getRelation('address')->visible(['name']);
$row->visible(['rider']);
$row->getRelation('rider')->visible(['nickname']);
}
$list = collection($list)->toArray();
$result = array("total" => $total, "rows" => $list);
... ...
... ... @@ -135,6 +135,6 @@ class Litestoreorder extends Model
public function rider()
{
return $this->belongsTo('app\admin\model\User','rider_user_id','id');
return $this->belongsTo('app\admin\model\User','rider_user_id','id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
... ... @@ -39,7 +39,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
formatter: Controller.api.status_formatter},
{field: 'updatetime', title: __('Updatetime'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'address.name', title: __('Address.name'),operate: false},
{field: 'rider_user_id', title: __('骑手用户id')},
{field: 'rider.nickname', title: __('骑手')},
{field: 'operate', title: __('Operate'), table: table, buttons: [
{name: 'send', text: __('view'), icon: 'fa fa-eye', classname: 'btn btn-xs btn-warning btn-dialog chakan', url: 'litestore/litestoreorder/detail'},
], events: Table.api.events.operate, formatter: Table.api.formatter.operate}
... ...