|
@@ -5,7 +5,7 @@ namespace App\Admin\Forms;
|
|
|
use Dcat\Admin\Contracts\LazyRenderable;
|
|
|
use Dcat\Admin\Widgets\Form;
|
|
|
use App\Admin\Repositories\DistInquiry;
|
|
|
-use App\Admin\Renderable\DistUserTable;
|
|
|
+use App\Admin\Renderable\DistDistributorTable;
|
|
|
use Dcat\Admin\Models\DistAdminUser;
|
|
|
use Dcat\Admin\Traits\LazyWidget;
|
|
|
|
|
@@ -14,7 +14,7 @@ class InquiryAssignment extends Form
|
|
|
// 处理请求
|
|
|
public function handle(array $input)
|
|
|
{
|
|
|
- $distUserId = $input['distUserId'] ?? null;
|
|
|
+ $distId = $input['distId'] ?? null;
|
|
|
$id = $input['id'] ?? null;
|
|
|
if (empty($id)) {
|
|
|
return $this->response()->error('No data selected!');
|
|
@@ -25,15 +25,15 @@ class InquiryAssignment extends Form
|
|
|
return $this->response()->error('The data cannot be assigned!');
|
|
|
}
|
|
|
//分配数据
|
|
|
- DistInquiry::assignData($ids, $distUserId);
|
|
|
+ DistInquiry::assignData($ids, $distId);
|
|
|
return $this->response()->success('allocation successful')->refresh();
|
|
|
}
|
|
|
|
|
|
public function form()
|
|
|
{
|
|
|
- $this->selectTable('distUserId', 'Select Username')
|
|
|
- ->title('distUserId')
|
|
|
- ->from(DistUserTable::make());
|
|
|
+ $this->selectTable('distId', 'Select Distributor')
|
|
|
+ ->title('distId')
|
|
|
+ ->from(DistDistributorTable::make());
|
|
|
// 设置隐藏表单,传递用户id
|
|
|
$this->hidden('id')->attribute('id', 'inquiryIds');
|
|
|
}
|