提交代码
This commit is contained in:
30
app/Admin/Actions/ProfitStart.php
Normal file
30
app/Admin/Actions/ProfitStart.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Actions;
|
||||
|
||||
use Admin;
|
||||
use Encore\Admin\Actions\RowAction;
|
||||
use Encore\Admin\Form;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ProfitStart extends RowAction
|
||||
{
|
||||
public $name = '执行全球分红';
|
||||
|
||||
public function handle(Model $model, Request $request)
|
||||
{
|
||||
$admin_pass = $request->admin_pass;
|
||||
if (!Admin::guard()->attempt(['username' => Admin::user()->username, 'password' => $admin_pass])) {
|
||||
return $this->response()->error('验证密码失败')->refresh();
|
||||
}
|
||||
\App\Bonus\ProfitStart::settlement($this->row);
|
||||
|
||||
return $this->response()->success('操作成功')->refresh();
|
||||
}
|
||||
|
||||
public function form()
|
||||
{
|
||||
$this->text('admin_pass', '当前管理员密码')->rules('required');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user