@@ -63,6 +63,18 @@ class Videoplatform extends Backend
{
return parent::add();
}
+ public function dragsort()
+ {
+ if ($this->request->isPost()) {
+ $ids = $this->request->post('ids');
+ // 根据 $ids 更新排序逻辑(示例代码)
+ foreach ($ids as $index => $id) {
+ $this->model::where('id', $id)->update(['sort' => $index + 1]);
+ }
+ $this->success();
+ $this->error(__('参数错误'));
// // 添加
// public function add()
// {
@@ -10,7 +10,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
edit_url: 'platform/videoplatform/edit',
del_url: 'platform/videoplatform/del',
multi_url: 'platform/videoplatform/multi',
- dragsort_url: 'ajax/weigh',
+ dragsort_url: 'platform/videoplatform/dragsort',
table: 'video_platform',
});