fastadmin别名关联表与js下划线冲突问题解决:with里的别名,不要用驼峰,用shippingtype

https://ask.fastadmin.net/question/9555.html

          {field: 'shippingtype.st_name', title: __('Type_id'),sortable: true,operate: 'LIKE %...%', placeholder: '关键字,模糊搜索',addClass:'selectpage',extend:'data-source="shippingtype" data-primary-key="st_id" data-show-field="st_name"',},

  controller端

$with_biBao=[
'admin' => function ($query) {
$query->withField('id,username');
},
'shippingtype'=> function ($query) {
$query->withField('st_id,st_name');
},
];
$total = $this->model

->with($with_biBao)
->where($where)
->order($sort, $order)
->count();

$list = $this->model

->with($with_biBao)
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();

原文地址:https://www.cnblogs.com/showker/p/13809191.html