update2022
This commit is contained in:
@@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use PhpOffice\PhpWord\Exception\CopyFileException;
|
use PhpOffice\PhpWord\Exception\CopyFileException;
|
||||||
use PhpOffice\PhpWord\Exception\CreateTemporaryFileException;
|
use PhpOffice\PhpWord\Exception\CreateTemporaryFileException;
|
||||||
use PhpOffice\PhpWord\TemplateProcessor;
|
use PhpOffice\PhpWord\TemplateProcessor;
|
||||||
|
use RuntimeException;
|
||||||
|
|
||||||
class DestroyData extends RowAction
|
class DestroyData extends RowAction
|
||||||
{
|
{
|
||||||
@@ -47,10 +48,10 @@ class DestroyData extends RowAction
|
|||||||
$download = $this->exportEqual($model);
|
$download = $this->exportEqual($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $model->logs()->delete();
|
$model->logs()->delete();
|
||||||
|
|
||||||
return $this->response()->success('数据销毁完成')->refresh()->download($download);
|
return $this->response()->success('数据销毁完成')->refresh()->download($download);
|
||||||
} catch (\RuntimeException $exception) {
|
} catch (RuntimeException $exception) {
|
||||||
return $this->response()->error('数据销毁失败'.$exception->getMessage())->refresh();
|
return $this->response()->error('数据销毁失败'.$exception->getMessage())->refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,8 +70,8 @@ class DestroyData extends RowAction
|
|||||||
{
|
{
|
||||||
$templateProcessor = new TemplateProcessor(storage_path('app/public/DENG_FEN.docx'));
|
$templateProcessor = new TemplateProcessor(storage_path('app/public/DENG_FEN.docx'));
|
||||||
|
|
||||||
$templateProcessor->setValue('TOTAL1', $vote->logs()->distinct('user_id')->count());
|
$templateProcessor->setValue('TOTAL', $vote->logs()->distinct('user_id')->count());
|
||||||
$templateProcessor->setValue('TITLE', $vote->title);
|
$templateProcessor->setValue('TITLE', strip_tags($vote->title));
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$tpl = '';
|
$tpl = '';
|
||||||
|
|||||||
@@ -23,7 +23,12 @@ class ItemController extends Controller
|
|||||||
protected function grid($vote)
|
protected function grid($vote)
|
||||||
{
|
{
|
||||||
$grid = new Grid(new Item);
|
$grid = new Grid(new Item);
|
||||||
$grid->model()->where('vote_id', $vote->id);
|
$grid->filter(function (Grid\Filter $v) {
|
||||||
|
$v->column(1 / 2, function (Grid\Filter $f) {
|
||||||
|
$f->like('name', '姓名');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$grid->model()->where('vote_id', $vote->id)->orderBy('sort');
|
||||||
$grid->column('cover')->image('', 80);
|
$grid->column('cover')->image('', 80);
|
||||||
$grid->column('id', '#ID#');
|
$grid->column('id', '#ID#');
|
||||||
$grid->column('name');
|
$grid->column('name');
|
||||||
|
|||||||
@@ -21,8 +21,14 @@ class UserController extends AdminController
|
|||||||
$tools->append(new UserImport);
|
$tools->append(new UserImport);
|
||||||
$tools->append(new CleanData);
|
$tools->append(new CleanData);
|
||||||
});
|
});
|
||||||
// $grid->disableCreateButton();
|
$grid->filter(function (Grid\Filter $v) {
|
||||||
// $grid->disableActions();
|
$v->column(1 / 2, function (Grid\Filter $f) {
|
||||||
|
$f->like('name', '姓名');
|
||||||
|
});
|
||||||
|
$v->column(1 / 2, function (Grid\Filter $f) {
|
||||||
|
$f->equal('mobile', '手机号');
|
||||||
|
});
|
||||||
|
});
|
||||||
$grid->column('归属干事')->display(function () {
|
$grid->column('归属干事')->display(function () {
|
||||||
return $this->parent->name ?? '';
|
return $this->parent->name ?? '';
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ class IndexController extends Controller
|
|||||||
function agent()
|
function agent()
|
||||||
{
|
{
|
||||||
if (Api::user()->type == 1) {
|
if (Api::user()->type == 1) {
|
||||||
$users = User::where('parent_id', Api::id())->select(['id', 'mobile', 'name', 'sign'])->get();
|
$users = User::where('parent_id', Api::id())->select(['id', 'mobile', 'name', 'sign'])->orderBy('sign')->get();
|
||||||
} else {
|
} else {
|
||||||
$users = User::where('type', 0)->select(['id', 'mobile', 'name', 'sign'])->get();
|
$users = User::where('type', 0)->select(['id', 'mobile', 'name', 'sign'])->orderBy('sign')->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
$vote = Vote::where('status', 1)->first();
|
$vote = Vote::where('status', 1)->first();
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class Kernel extends HttpKernel
|
|||||||
],
|
],
|
||||||
|
|
||||||
'api' => [
|
'api' => [
|
||||||
'throttle:60,1',
|
'throttle:600,1',
|
||||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
BIN
storage/.DS_Store
vendored
Normal file
BIN
storage/.DS_Store
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user