change address rule, email content and admin event crud
This commit is contained in:
@ -23,6 +23,7 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
//use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||
//use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation { update as traitUpdate; }
|
||||
use \RedSquirrelStudio\LaravelBackpackExportOperation\ExportOperation;
|
||||
|
||||
|
||||
/**
|
||||
@ -37,6 +38,57 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
CRUD::setEntityNameStrings('活動:反轉代謝新人生', '活動:反轉代謝新人生');
|
||||
}
|
||||
|
||||
protected function setupExportOperation()
|
||||
{
|
||||
CRUD::addColumns([
|
||||
[
|
||||
'name' => 'id',
|
||||
'label' => 'ID',
|
||||
'type' => 'text',
|
||||
'prefix' => 'A-'
|
||||
],
|
||||
[
|
||||
'name' => 'check_state',
|
||||
'label' => '審核狀態',
|
||||
'type' => 'select_from_array',
|
||||
'options' => ['1' => '未審核 ', '2' => '通過 〇', '3' => '未通過 ✖'],
|
||||
],
|
||||
[
|
||||
'name' => 'hospital_name',
|
||||
'label' => '就醫院所',
|
||||
'type' => 'text',
|
||||
],
|
||||
[
|
||||
'name' => 'name',
|
||||
'label' => '姓名',
|
||||
'type' => 'text',
|
||||
],
|
||||
[
|
||||
'name' => 'twid',
|
||||
'label' => '身份證',
|
||||
'type' => 'text',
|
||||
],
|
||||
[
|
||||
'name' => 'phone',
|
||||
'label' => '手機號碼',
|
||||
'type' => 'text',
|
||||
],
|
||||
[
|
||||
'name' => 'email',
|
||||
'label' => 'Email',
|
||||
'type' => 'text',
|
||||
],
|
||||
[
|
||||
'name' => 'address',
|
||||
'label' => '地址',
|
||||
'type' => 'textarea',
|
||||
],
|
||||
]);
|
||||
|
||||
$this->setupListOperation();
|
||||
$this->disableUserConfiguration();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define what happens when the List operation is loaded.
|
||||
*
|
||||
@ -45,7 +97,42 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
*/
|
||||
protected function setupListOperation()
|
||||
{
|
||||
CRUD::filter('審核狀態')
|
||||
->type('dropdown')
|
||||
->values([
|
||||
1 => '未審核',
|
||||
2 => '通過 〇',
|
||||
3 => '未通過 ✖'
|
||||
|
||||
])
|
||||
->whenActive(function($value) {
|
||||
CRUD::addClause('where', 'check_state', $value);
|
||||
});
|
||||
CRUD::filter('ID')
|
||||
->type('text')
|
||||
->whenActive(function($value) {
|
||||
CRUD::addClause('where', 'id', $value);
|
||||
});
|
||||
CRUD::filter('就醫院所')
|
||||
->type('text')
|
||||
->whenActive(function($value) {
|
||||
CRUD::addClause('where', 'hospital_name', 'LIKE', "%$value%");
|
||||
});
|
||||
CRUD::filter('姓名')
|
||||
->type('text')
|
||||
->whenActive(function($value) {
|
||||
CRUD::addClause('where', 'name', 'LIKE', "%$value%");
|
||||
});
|
||||
|
||||
$this->crud->addColumns([
|
||||
[
|
||||
'name' => 'id',
|
||||
'label' => '報名流水號',
|
||||
'type' => 'text',
|
||||
'value' => function($entry) {
|
||||
return 'C-'. str_pad($entry->id, 6, '0', STR_PAD_LEFT);
|
||||
}
|
||||
],
|
||||
[
|
||||
'name' => 'created_at',
|
||||
'label' => '登記時間',
|
||||
@ -68,7 +155,11 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
'label' => '姓名',
|
||||
'type' => 'text'
|
||||
],
|
||||
|
||||
[
|
||||
'name' => 'hospital_name',
|
||||
'label' => '就醫院所',
|
||||
'type' => 'text',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
@ -142,7 +233,7 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
'url' => function ($crud) {
|
||||
$entry = $crud->getCurrentEntry();
|
||||
$path = str_replace("uploads/", "", $entry->record_card_img_src);
|
||||
return $path ? route('storage.serve', $path) : "about:blank";
|
||||
return $path ? route('storage.serve', $path) : "";
|
||||
},
|
||||
'width' => '400px',
|
||||
'height' => '300px',
|
||||
@ -157,7 +248,7 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
'url' => function ($crud) {
|
||||
$entry = $crud->getCurrentEntry();
|
||||
$path = str_replace("uploads/", "", $entry->twid_front_img_src);
|
||||
return $path ? route('storage.serve', $path) : "about:blank";
|
||||
return $path ? route('storage.serve', $path) : "";
|
||||
},
|
||||
'width' => '400px',
|
||||
'height' => '300px',
|
||||
@ -172,7 +263,7 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
'url' => function ($crud) {
|
||||
$entry = $crud->getCurrentEntry();
|
||||
$path = str_replace("uploads/", "", $entry->twid_back_img_src);
|
||||
return $path ? route('storage.serve', $path) : "about:blank";
|
||||
return $path ? route('storage.serve', $path) : "";
|
||||
},
|
||||
'width' => '400px',
|
||||
'height' => '300px',
|
||||
@ -187,7 +278,7 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
'url' => function ($crud) {
|
||||
$entry = $crud->getCurrentEntry();
|
||||
$path = str_replace("uploads/", "", $entry->exam_1st_img_src);
|
||||
return $path ? route('storage.serve', $path) : "about:blank";
|
||||
return $path ? route('storage.serve', $path) : "";
|
||||
},
|
||||
'width' => '400px',
|
||||
'height' => '300px',
|
||||
@ -202,7 +293,7 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
'url' => function ($crud) {
|
||||
$entry = $crud->getCurrentEntry();
|
||||
$path = str_replace("uploads/", "", $entry->exam_2nd_img_src);
|
||||
return $path ? route('storage.serve', $path) : "about:blank";
|
||||
return $path ? route('storage.serve', $path) : "";
|
||||
},
|
||||
'width' => '400px',
|
||||
'height' => '300px',
|
||||
@ -230,12 +321,15 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
"title" => "反轉代謝新人生 皮蛇疫苗加碼補 審核通過!",
|
||||
"body" => "恭喜您審核通過!"
|
||||
."\n\n登記資料:"
|
||||
."\n流水號: C-".str_pad($entry->id, 6, '0', STR_PAD_LEFT)
|
||||
."\n就醫院所:".$entry->hospital_name
|
||||
."\n姓名:".$entry->name
|
||||
."\n身份證字號:".substr($entry->twid,0,2)."xxxx".substr($entry->twid,-4)
|
||||
."\n行動電話:".$entry->phone
|
||||
."\n電子信箱:".$entry->email
|
||||
."\n收件地址:".$entry->address
|
||||
."\n\n中獎公告:本活動將於10月抽出得獎名單並公告於「活動網站/最新消息」及「桃園市政府衛生局網站/訊息公告/最新消息」。"
|
||||
|
||||
,
|
||||
]));
|
||||
} catch (Exception $ex) {
|
||||
@ -250,6 +344,7 @@ class EventHealthAllowanceCrudController extends CrudController
|
||||
."\n請依以下理由重新上活動網站登記"
|
||||
."\n理由:".$entry->check_reson
|
||||
."\n\n登記資料:"
|
||||
."\n流水號: C-".str_pad($entry->id, 6, '0', STR_PAD_LEFT)
|
||||
."\n就醫院所:".$entry->hospital_name
|
||||
."\n姓名:".$entry->name
|
||||
."\n身份證字號:".substr($entry->twid,0,2)."xxxx".substr($entry->twid,-4)
|
||||
|
Reference in New Issue
Block a user