You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
878 B
31 lines
878 B
<?php |
|
|
|
namespace App\Admin\Actions\Form\Follow; |
|
|
|
use App\Models\UsersMember; |
|
use Dcat\Admin\Traits\LazyWidget; |
|
use Dcat\Admin\Widgets\Form; |
|
|
|
class EditEnrollStatusForm extends Form |
|
{ |
|
use LazyWidget; |
|
|
|
|
|
public function handle(array $input) |
|
{ |
|
$input['update_time'] = time(); |
|
$unique_number = $this->payload['unique_number']; |
|
$editSql = UsersMember::query()->where(['unique_number' => $unique_number])->update($input); |
|
if (!$editSql) { |
|
return $this->response()->error('修改录取状态失败'); |
|
} |
|
|
|
return $this->response()->success('修改录取状态成功')->refresh(); |
|
} |
|
|
|
|
|
public function form(): void |
|
{ |
|
$this->select("enroll_status", "录取状态")->options(['1' => '已录取', '2' => '取消录取'])->default($unique_number = $this->payload['enroll_status'])->required(); |
|
} |
|
}
|
|
|