虚心使人进步

虚心学习,天天向上......
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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();