diff --git a/app/Http/Controllers/Admin/InformationController.php b/app/Http/Controllers/Admin/InformationController.php new file mode 100644 index 0000000..432689d --- /dev/null +++ b/app/Http/Controllers/Admin/InformationController.php @@ -0,0 +1,44 @@ +input('period', 'month'); // デフォルト: 最新1ヵ月 + + $query = DB::table('bat_job_log') + ->leftJoin('device', 'bat_job_log.device_id', '=', 'device.device_id') + ->select( + 'bat_job_log.job_log_id', + 'bat_job_log.process_name', + 'bat_job_log.job_name', + 'bat_job_log.device_id', + 'device.park_id', + 'bat_job_log.status_comment', + 'bat_job_log.status', + 'bat_job_log.status_comment as comment', + 'bat_job_log.created_at', + 'bat_job_log.updated_at' + ); + + // 期間フィルター + if ($period === 'month') { + $query->where('bat_job_log.updated_at', '>=', now()->subMonth()); + } + // 'all'の場合はフィルターなし + + $jobs = $query->orderByDesc('bat_job_log.job_log_id')->limit(50)->get(); + + return view('admin.information.list', [ + 'jobs' => $jobs, + 'period' => $period, + ]); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/OpesController.php b/app/Http/Controllers/Admin/OpesController.php new file mode 100644 index 0000000..f9e182b --- /dev/null +++ b/app/Http/Controllers/Admin/OpesController.php @@ -0,0 +1,230 @@ +filled('user_id')) { + $query->where('user_id', $request->input('user_id')); + } + + $users = $query->paginate(20); + + return view('admin.personal.list', [ + 'users' => $users, + 'request' => $request, + ]); + } + + /** + * 本人確認手動処理 編集画面 + */ + public function edit(Request $request, $id) + { + // 利用者情報取得 + $user = User::where('user_id', $id)->firstOrFail(); + + // 利用者分類マスタ取得(ラジオボタン用) + $usertypes = Usertype::orderBy('sort_order')->get(); + + // POST時の処理 + if ($request->isMethod('post')) { + // 利用者分類IDの更新 + $user->user_categoryid = $request->input('user_categoryid', $user->user_categoryid); + + // 本人確認チェックOK/NG + if ($request->input('check') === 'ok') { + $user->user_idcard_chk_flag = 1; + } elseif ($request->input('check') === 'ng') { + $user->user_idcard_chk_flag = 0; + // 備考欄も更新(NG理由) + $user->user_remarks = $request->input('user_remarks', $user->user_remarks); + } + + $user->save(); + + return redirect()->route('personal')->with('success', '更新しました'); + } + + return view('admin.personal.edit', [ + 'user' => $user, + 'usertypes' => $usertypes, + ]); + } +} + +class OpesController extends Controller +{ + /** + * オペレータ一覧画面 + */ + public function list(Request $request) + { + $sort = $request->input('sort', 'ope_id'); // デフォルト値を設定 + $sort_type = $request->input('sort_type', 'asc'); // デフォルト値を設定 + + $query = Ope::query(); + + // 並び替え + $query->orderBy($sort, $sort_type); + + $list = $query->paginate(20); + + return view('admin.opes.list', [ + 'list' => $list, + 'sort' => $sort, + 'sort_type' => $sort_type, + 'request' => $request, + ]); + } + + /** + * オペレータ編集画面 + */ + public function edit(Request $request, $id) + { + $ope = \App\Models\Ope::findOrFail($id); + + if ($request->isMethod('post')) { + // バリデーション&更新処理 + // ... + } + + // 各項目を配列で渡す + return view('admin.opes.edit', [ + 'ope_id' => $ope->ope_id, + 'ope_name' => $ope->ope_name, + 'login_id' => $ope->login_id, + 'ope_pass' => '', // パスワードは空で + 'ope_belong' => $ope->ope_belong, + 'ope_type' => $ope->ope_type, + 'ope_mail' => $ope->ope_mail, + 'ope_phone' => $ope->ope_phone, + 'ope_sendalart_que1' => $ope->ope_sendalart_que1, + 'ope_sendalart_que2' => $ope->ope_sendalart_que2, + 'ope_sendalart_que3' => $ope->ope_sendalart_que3, + 'ope_sendalart_que4' => $ope->ope_sendalart_que4, + 'ope_sendalart_que5' => $ope->ope_sendalart_que5, + 'ope_sendalart_que6' => $ope->ope_sendalart_que6, + 'ope_sendalart_que7' => $ope->ope_sendalart_que7, + 'ope_sendalart_que8' => $ope->ope_sendalart_que8, + 'ope_sendalart_que9' => $ope->ope_sendalart_que9, + 'ope_sendalart_que10' => $ope->ope_sendalart_que10, + 'ope_sendalart_que11' => $ope->ope_sendalart_que11, + 'ope_sendalart_que12' => $ope->ope_sendalart_que12, + 'ope_sendalart_que13' => $ope->ope_sendalart_que13, + 'ope_auth1' => $ope->ope_auth1, + 'ope_auth2' => $ope->ope_auth2, + 'ope_auth3' => $ope->ope_auth3, + 'ope_auth4' => $ope->ope_auth4, + 'ope_quit_flag' => $ope->ope_quit_flag, + 'ope_quitday' => $ope->ope_quitday, + ]); + } + + /** + * オペレータ一覧のエクスポート + */ + public function export(Request $request) + { + $filename = 'ope_export_' . date('Ymd_His') . '.csv'; + $columns = [ + 'ope_id', 'ope_belong', 'login_id', 'ope_name', 'ope_pass', 'ope_type', 'ope_mail', 'ope_phone', + 'ope_sendalart_que1', 'ope_sendalart_que2', 'ope_sendalart_que3', 'ope_sendalart_que4', 'ope_sendalart_que5', + 'ope_sendalart_que6', 'ope_sendalart_que7', 'ope_sendalart_que8', 'ope_sendalart_que9', 'ope_sendalart_que10', + 'ope_sendalart_que11', 'ope_sendalart_que12', 'ope_sendalart_que13', + 'ope_auth1', 'ope_auth2', 'ope_auth3', 'ope_auth4', + 'ope_quit_flag', 'ope_quitday', 'created_at', 'updated_at' + ]; + + $ids = $request->input('pk', []); + if (!empty($ids)) { + $list = \App\Models\Ope::whereIn('ope_id', $ids)->select($columns)->get(); + } else { + $list = \App\Models\Ope::select($columns)->get(); + } + + $callback = function() use ($list, $columns) { + $file = fopen('php://output', 'w'); + // ヘッダー + fputcsv($file, $columns); + + foreach ($list as $row) { + $data = []; + foreach ($columns as $col) { + $data[] = $row->$col; + } + fputcsv($file, $data); + } + fclose($file); + }; + + return response()->stream($callback, 200, [ + "Content-Type" => "text/csv", + "Content-Disposition" => "attachment; filename={$filename}", + ]); + } + + /** + * オペレータの削除 + */ + public function delete(Request $request) + { + // チェックされたIDの配列を受け取る想定 + $ids = $request->input('pk', []); + if (!empty($ids)) { + \App\Models\Ope::whereIn('ope_id', $ids)->delete(); + return redirect()->route('opes')->with('success', '削除しました'); + } + return redirect()->route('opes')->with('error', '削除対象が選択されていません'); + } + + /** + * オペレータの追加 + */ + public function add(Request $request) + { + if ($request->isMethod('post')) { + $validated = $request->validate([ + 'ope_name' => 'required|string|max:255', + 'login_id' => 'required|string|max:255|unique:ope,login_id', + 'password' => 'required|string|min:6|confirmed', + 'ope_type' => 'required', + 'ope_mail' => 'required|email', + ]); + $ope = new \App\Models\Ope(); + $ope->ope_name = $request->ope_name; + $ope->login_id = $request->login_id; + $ope->ope_pass = bcrypt($request->password); + $ope->ope_type = $request->ope_type; + $ope->ope_mail = $request->ope_mail; + $ope->ope_phone = $request->ope_phone; + for ($i = 1; $i <= 13; $i++) { + $field = "ope_sendalart_que{$i}"; + $ope->$field = $request->$field ?? 0; + } + for ($i = 1; $i <= 4; $i++) { + $field = "ope_auth{$i}"; + $ope->$field = $request->$field ?? ''; + } + $ope->ope_quit_flag = $request->ope_quit_flag ?? 0; + $ope->ope_quitday = $request->ope_quitday ?? null; + $ope->save(); + return redirect()->route('opes')->with('success', '登録しました'); + } + return view('admin.opes.add'); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/ParkController.php b/app/Http/Controllers/Admin/ParkController.php index 7a175fb..e3b2e88 100644 --- a/app/Http/Controllers/Admin/ParkController.php +++ b/app/Http/Controllers/Admin/ParkController.php @@ -44,10 +44,12 @@ class ParkController extends Controller $query->orderBy('p.park_id', 'asc'); } - $parks = $query->paginate(20); - $cities = \DB::table('city')->orderBy('city_id')->get(); + $parks = $query->paginate(20); + $cities = \DB::table('city')->orderBy('city_id')->get(); - return view('admin.parks.list', compact('parks', 'cities')); + $sort = $request->input('sort', 'p.park_id'); + $sort_type = $request->input('sort_type', 'asc'); + return view('admin.parks.list', compact('parks', 'cities', 'sort', 'sort_type')); } public function add(Request $request) @@ -77,14 +79,14 @@ class ParkController extends Controller public function edit(Request $request, $pk, $view = '') { - $park = Park::getByPk($pk); + $park = Park::find($pk); if (empty($pk) || empty($park)) { abort('404'); } $data = $park->getAttributes(); $dataList = $this->getDataDropList(); $data = array_merge($data, $dataList); - if ($request->isMethod('POST')) { + if ($request->isMethod('POST') || $request->isMethod('PUT')) { // ここをaddと同じバリデーションに変更 $validated = $request->validate([ 'city_id' => 'required|integer', @@ -114,7 +116,7 @@ class ParkController extends Controller { $arr_pk = $request->get('pk'); if ($arr_pk) { - if (Park::deleteByPk($arr_pk)) { + if (Park::destroy($arr_pk)) { return redirect()->route('parks')->with('success', __("削除が完了しました。")); } else { return redirect()->route('parks')->with('error', __('削除に失敗しました。')); @@ -153,7 +155,23 @@ class ParkController extends Controller ]; - $dataExport = Park::search($inputs); + $dataExport = \DB::table('park as p') + ->leftJoin('city as c', 'p.city_id', '=', 'c.city_id') + ->select([ + 'p.park_id', + 'c.city_name', + 'p.park_name', + 'p.park_ruby', + 'p.park_syllabary', + 'p.park_adrs', + 'p.park_close_flag', + 'p.park_day', + 'p.alert_flag', + 'p.print_number', + 'p.keep_alive', + ]) + ->orderBy('p.park_id', 'asc') + ->get(); $columns = array( __('駐輪場ID '),// 0 __('市区ID'),// 1 @@ -177,14 +195,14 @@ class ParkController extends Controller $file, array( $items->park_id,// 0 - $items->city_id,// 1 - !empty($items->getCity()) ? $items->getCity()->city_name : "",// 2 + null, // city_id(selectで取得していないので空欄) + $items->city_name ?? '',// 2 $items->park_name, // 3 $items->park_ruby, // 4 $items->park_syllabary, // 5 $items->park_adrs, // 6 $items->park_close_flag,// 7 - $items->getParkCloseFlagDisplay(),// 8 + ($items->park_close_flag == 1 ? '閉設' : '開設'),// 8 $items->park_day,// 9 $items->alert_flag,// 10 $items->print_number,// 11 diff --git a/app/Http/Controllers/Admin/PersonalController.php b/app/Http/Controllers/Admin/PersonalController.php new file mode 100644 index 0000000..72641d5 --- /dev/null +++ b/app/Http/Controllers/Admin/PersonalController.php @@ -0,0 +1,66 @@ +filled('user_id')) { + $query->where('user_id', $request->input('user_id')); + } + + $users = $query->paginate(20); + + return view('admin.personal.list', [ + 'users' => $users, + 'request' => $request, + ]); + } + + /** + * 本人確認手動処理 編集画面 + */ + public function edit(Request $request, $id) + { + // 利用者情報取得 + $user = User::where('user_id', $id)->firstOrFail(); + + // 利用者分類マスタ取得(ラジオボタン用) + $usertypes = Usertype::orderBy('sort_order')->get(); + + // POST時の処理 + if ($request->isMethod('post')) { + // 利用者分類IDの更新 + $user->user_categoryid = $request->input('user_categoryid', $user->user_categoryid); + + // 本人確認チェックOK/NG + if ($request->input('check') === 'ok') { + $user->user_idcard_chk_flag = 1; + } elseif ($request->input('check') === 'ng') { + $user->user_idcard_chk_flag = 0; + // 備考欄も更新(NG理由) + $user->user_remarks = $request->input('user_remarks', $user->user_remarks); + } + + $user->save(); + + return redirect()->route('personal')->with('success', '更新しました'); + } + + return view('admin.personal.edit', [ + 'user' => $user, + 'usertypes' => $usertypes, + ]); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/PriceController.php b/app/Http/Controllers/Admin/PriceController.php index 81f9cc1..f7a7d25 100644 --- a/app/Http/Controllers/Admin/PriceController.php +++ b/app/Http/Controllers/Admin/PriceController.php @@ -36,40 +36,33 @@ class PriceController extends Controller public function add(Request $request) { $inputs = [ + 'price_parkplaceid' => $request->input('price_parkplaceid'), // 駐車場所ID + 'park_id' => $request->input('park_id'), // 駐輪場ID 'prine_name' => $request->input('prine_name'), // 商品名 'price_month' => $request->input('price_month',''), // 期間 - 'park_id' => $request->input('park_name'), // 駐輪場 - 'psection_id' => $request->input('psection_subject'), // 車種区分 - 'price_ptypeid' => $request->input('ptype_subject'), // 駐輪分類 - 'user_categoryid' => $request->input('user_category_name'), // 利用者分類 - 'pplace_id' => $request->input('pplace_id'), // 駐車車室 + 'user_categoryid' => $request->input('user_categoryid'), // 利用者分類ID 'price' => $request->input('price'), // 駐輪料金(税込) + 'psection_id' => $request->input('psection_id'), // 車種区分ID + 'price_ptypeid' => $request->input('price_ptypeid'), // 駐輪分類ID + 'pplace_id' => $request->input('pplace_id'), // 駐車車室ID ]; $dataList = $this->getDataDropList(); $inputs = array_merge($inputs, $dataList); if ($request->isMethod('POST')) { $type = false; - $validation = new PriceRequest(); - $rules = $validation->rules(); - $validator = Validator::make($request->all(), $rules, $validation->messages()); - if (!$validator->fails()) { - \DB::transaction(function () use ($inputs, &$type) { - $new = new Price(); - $new->fill($inputs); - if( $new->save()){ - $type = true; - } - - }); - if ($type) { - $request->session()->flash('success', __('新しい成功を創造する。')); - return redirect()->route('prices'); - } else { - $request->session()->flash('error', __('新しい作成に失敗しました')); + \DB::transaction(function () use ($inputs, &$type) { + $new = new Price(); + $new->fill($inputs); + if( $new->save()){ + $type = true; } - }else { - $inputs['errorMsg'] = $this->__buildErrorMessasges($validator); + }); + if ($type) { + $request->session()->flash('success', __('新しい成功を創造する。')); + return redirect()->route('prices'); + } else { + $request->session()->flash('error', __('新しい作成に失敗しました')); } } @@ -86,29 +79,28 @@ class PriceController extends Controller $data = array_merge($data, $dataList); if ($request->isMethod('POST')) { $type = false; - $validation = new PriceRequest(); - $rules = $validation->rules(); - $validator = Validator::make($request->all(), $rules, $validation->messages()); - $requestAll = $request->all(); - $requestAll['price_ptypeid]'] = $request->input('ptype_subject'); - $requestAll['user_categoryid'] = $request->input('user_category_name'); // 利用者分類 - $requestAll['psection_id'] = $request->input('psection_subject'); - $requestAll['park_id'] = $request->input('park_name'); + $requestAll = [ + 'price_parkplaceid' => $request->input('price_parkplaceid'), + 'park_id' => $request->input('park_id'), + 'prine_name' => $request->input('prine_name'), + 'price_month' => $request->input('price_month',''), + 'user_categoryid' => $request->input('user_categoryid'), + 'price' => $request->input('price'), + 'psection_id' => $request->input('psection_id'), + 'price_ptypeid' => $request->input('price_ptypeid'), + 'pplace_id' => $request->input('pplace_id'), + ]; $data = array_merge($data, $requestAll); - if (!$validator->fails()) { - \DB::transaction(function () use ($data, &$type,$price) { - $price->fill($data); - $price->save(); - $type = true; - }); - if ($type) { - $request->session()->flash('success', __('更新に成功しました')); - return redirect()->route('prices'); - } else { - $request->session()->flash('error', __('更新に失敗しました')); - } - }else { - $data['errorMsg'] = $this->__buildErrorMessasges($validator); + \DB::transaction(function () use ($data, &$type,$price) { + $price->fill($data); + $price->save(); + $type = true; + }); + if ($type) { + $request->session()->flash('success', __('更新に成功しました')); + return redirect()->route('prices'); + } else { + $request->session()->flash('error', __('更新に失敗しました')); } } if ($view != '') { diff --git a/app/Http/Controllers/Admin/SealsController.php b/app/Http/Controllers/Admin/SealsController.php new file mode 100644 index 0000000..43a770c --- /dev/null +++ b/app/Http/Controllers/Admin/SealsController.php @@ -0,0 +1,28 @@ +input('sort', 'seal_issueid'); + $sort_type = $request->input('sort_type', 'desc'); + + // sealテーブルを参照し、ソート + $list = DB::table('seal') + ->orderBy($sort, $sort_type) + ->paginate(20); + + return view('admin.seals.list', [ + 'list' => $list, + 'sort' => $sort, + 'sort_type' => $sort_type, + ]); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/TagissueController.php b/app/Http/Controllers/Admin/TagissueController.php new file mode 100644 index 0000000..6f1cbca --- /dev/null +++ b/app/Http/Controllers/Admin/TagissueController.php @@ -0,0 +1,41 @@ +select( + 'user_seq', + 'user_tag_serial', + 'user_tag_serial_64', + 'user_tag_issue', + 'user_name', + 'user_mobile', + 'user_homephone', + 'user_regident_zip', + 'user_regident_pre', + 'user_regident_city', + 'user_regident_add' + ) + ->orderByDesc('user_seq'); + + // 必要に応じてフィルタ追加 + // if ($request->filled('user_tag_issue')) { + // $query->where('user_tag_issue', $request->input('user_tag_issue')); + // } + + $users = $query->paginate(20); + + return view('admin.tag_issue.list', [ + 'users' => $users, + ]); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php new file mode 100644 index 0000000..c764940 --- /dev/null +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -0,0 +1,61 @@ +validate([ + 'email' => 'required|email', + 'email_confirmation' => 'required|email|same:email', + ], [ + 'email.required' => 'メールアドレスを入力してください。', + 'email.email' => '正しいメールアドレス形式で入力してください。', + 'email_confirmation.required' => '確認用メールアドレスを入力してください。', + 'email_confirmation.email' => '正しいメールアドレス形式で入力してください。', + 'email_confirmation.same' => 'メールアドレスが一致しません。', + ]); + + // ope_mailでユーザーを検索 + $user = \App\Models\Ope::where('ope_mail', $request->input('email'))->first(); + + if (!$user) { + return back()->withErrors(['email' => '該当するユーザーが見つかりません。']); + } + + // トークン生成 + $token = Str::random(60); + + // トークン保存(既存レコードがあれば更新) + DB::table('password_reset_tokens')->updateOrInsert( + ['ope_mail' => $user->ope_mail], + [ + 'token' => $token, + 'created_at' => now(), + ] + ); + + // メール送信 + $resetUrl = url('/reset-password?token=' . $token . '&email=' . urlencode($user->ope_mail)); + Mail::raw("下記URLからパスワード再設定を行ってください。\n\n{$resetUrl}", function ($message) use ($user) { + $message->to($user->ope_mail) + ->subject('パスワード再設定のご案内'); + }); + + return back()->with('status', 'パスワード再設定メールを送信しました。'); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php new file mode 100644 index 0000000..6e1a896 --- /dev/null +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -0,0 +1,51 @@ +query('token'); + $email = $request->query('email'); + return view('auth.reset-password', compact('token', 'email')); + } + + public function reset(Request $request) + { + $request->validate([ + 'email' => 'required|email', + 'token' => 'required', + 'password' => 'required|confirmed|min:8', + ]); + + // トークンチェック + $record = DB::table('password_reset_tokens') + ->where('ope_mail', $request->email) + ->where('token', $request->token) + ->first(); + + if (!$record) { + return back()->withErrors(['email' => '無効なトークンまたはメールアドレスです。']); + } + + // パスワード更新 + $user = Ope::where('ope_mail', $request->email)->first(); + if (!$user) { + return back()->withErrors(['email' => 'ユーザーが見つかりません。']); + } + $user->password = Hash::make($request->password); + $user->save(); + + // トークン削除 + DB::table('password_reset_tokens')->where('ope_mail', $request->email)->delete(); + + return redirect()->route('login')->with('status', 'パスワードを再設定しました。'); + } +} \ No newline at end of file diff --git a/app/Legacy/User.php b/app/Legacy/User.php index 4db6eee..0a367c3 100644 --- a/app/Legacy/User.php +++ b/app/Legacy/User.php @@ -66,7 +66,6 @@ class User extends Model 'user_remarks', 'user_age', ]; - protected static function boot() { parent::boot(); diff --git a/app/Models/Park.php b/app/Models/Park.php index 7b0368e..80060ef 100644 --- a/app/Models/Park.php +++ b/app/Models/Park.php @@ -2,35 +2,135 @@ namespace App\Models; +use App\Utils; +use App\Models\City; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Facades\Auth; -/** - * 駐輪場モデル - parkテーブル(正式モデル) - * 旧UsingStatusParkの責務を置き換え - */ class Park extends Model { + const CREATED_AT = 'created_at'; + const UPDATED_AT = 'updated_at'; + protected $table = 'park'; protected $primaryKey = 'park_id'; - public $timestamps = true; - - public const CREATED_AT = 'created_at'; - public const UPDATED_AT = 'updated_at'; protected $fillable = [ - 'park_name', - 'park_ruby', - 'park_syllabary', - 'park_adrs', - 'park_close_flag', - 'park_day', - 'alert_flag', - 'print_number', - 'keep_alive', - 'city_id', - 'operator_id', + 'park_id', // 駐輪場ID + 'city_id', // 市区 + 'park_name', // 駐輪場名 + 'park_ruby', // 駐輪場ふりがな + 'park_syllabary', // 駐輪場五十音 + 'park_adrs', // 住所 + 'park_close_flag', // 閉設フラグ + 'park_day', // 閉設日 + 'price_memo', // 価格メモ + 'alert_flag', // 残警告チェックフラグ + 'print_number', // 印字数 + 'keep_alive', // 最新キープアライブ + 'renew_start_date', // 更新期間開始日 + 'renew_start_time', // 更新期間開始時 + 'renew_end_date', // 更新期間終了日 + 'renew_end_time', // 更新期間終了時 + 'parking_start_period', // 駐輪開始期間 + 'reminder_type', // リマインダー種別 + 'reminder_time', // リマインダー時間 + 'immediate_use_after_contract', // 契約後即利用許可 + 'display_gender', // 項目表示設定:性別 + 'display_birthday', // 項目表示設定:生年月日 + 'display_security_registration_number', // 項目表示設定:防犯登録番号 + 'distance_between_two_points', // 二点間距離 + 'latitude', // 駐車場座標(緯度) + 'longitude', // 駐車場座標(経度) + 'phone_number', // 電話番号 + 'contract_type_regular', // 駐輪場契約形態(定期) + 'contract_type_temporary', // 駐輪場契約形態(一時利用) + 'vehicle_type_limit', // 車種制限 + 'procedure_method', // 手続方法 + 'payment_method', // 支払方法 + 'usage_time_limit_flag', // 利用可能時間制限フラグ + 'usage_time_start', // 利用可能時間(開始) + 'usage_time_end', // 利用可能時間(終了) + 'resident_manager_flag', // 常駐管理人フラグ + 'resident_time_start', // 常駐時間(開始) + 'resident_time_end', // 常駐時間(終了) + 'roof_flag', // 屋根フラグ + 'seal_issuing_machine_flag', // シール発行機フラグ + 'usage_method', // 駐輪場利用方法 + 'periodic_update_period', // 定期更新期間 + 'waiting_reservation', // 空き待ち予約 + 'special_notes', // 特記事項 + 'student_id_confirmation_type', // 学生証確認種別 + 'reduction_guide_display_flag', // 減免案内表示フラグ + 'reduction_target_age', // 減免対象年齢 + 'reduction_guide_display_start_month', // 減免案内表示開始月数 + 'cross_year' // 年跨ぎ + // 如有 created_at/updated_at 可省略不填 ]; + public static function search($inputs) + { + $list = self::query(); + if ($inputs['isMethodPost']) { + // 搜索条件可追加 + } + // Sort + if ($inputs['sort']) { + $list->orderBy($inputs['sort'], $inputs['sort_type']); + } + if ($inputs['isExport']){ + $list = $list->get(); + }else{ + $list = $list->paginate(Utils::item_per_page); + } + return $list; + } + + public static function getByPk($pk) + { + return self::find($pk); + } + + public static function deleteByPk($arr) + { + return self::whereIn('park_id', $arr)->delete(); + } + + public static function boot() + { + parent::boot(); + self::creating(function (Park $model) { + $model->operator_id = Auth::user()->ope_id ?? null; + }); + } + + /** + * GET 閉設フラグ + */ + public function getParkCloseFlagDisplay() { + if($this->park_close_flag == 1) { + return '閉設'; + } + else if($this->park_close_flag == 0) { + return '開設'; + } + return ''; + } + + public function getCity() + { + // city_id => city_id (City モデル要有 city_id PK) + return $this->belongsTo(City::class, 'city_id', 'city_id')->first(); + } + + public static function getList(){ + return self::pluck('park_name','park_id'); + } + + public static function getIdByName($park_name){ + return self::where('park_name',$park_name)->pluck('park_id')->first(); + } + /** * 料金設定との関連付け * @return \Illuminate\Database\Eloquent\Relations\HasMany @@ -39,6 +139,5 @@ class Park extends Model { return $this->hasMany(PriceA::class, 'park_id', 'park_id'); } + } - - diff --git a/app/Models/Ptype.php b/app/Models/Ptype.php index f8adcf2..aeb6fe6 100644 --- a/app/Models/Ptype.php +++ b/app/Models/Ptype.php @@ -4,12 +4,24 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; -/** - * 車種分類モデル - ptypeテーブル(正式モデル) - * 旧UsingStatusPtypeの責務を置き換え - */ class Ptype extends Model { + + /** + * 主キー配列で一括削除 + */ + public static function deleteByPk($arr) + { + return self::whereIn('ptype_id', $arr)->delete(); + } + + /** + * 主キーで1件取得 + */ + public static function getByPk($pk) + { + return self::find($pk); + } protected $table = 'ptype'; protected $primaryKey = 'ptype_id'; public $timestamps = true; @@ -23,9 +35,28 @@ class Ptype extends Model 'operator_id', ]; - /** - * 料金設定 - */ + public static function search($inputs) + { + $list = self::query(); + if (!empty($inputs['isMethodPost'])) { + // 必要に応じて検索条件を追加 + } + if (!empty($inputs['sort'])) { + $list->orderBy($inputs['sort'], $inputs['sort_type'] ?? 'asc'); + } + if (!empty($inputs['isExport'])) { + return $list->get(); + } else { + return $list->paginate(\App\Models\Utils::item_per_page); + } + } + + public static function getList() + { + return self::pluck('ptype_subject', 'ptype_id'); + } + + public function prices() { return $this->hasMany(PriceA::class, 'price_ptypeid', 'ptype_id'); @@ -33,3 +64,5 @@ class Ptype extends Model } + + diff --git a/public/index.php b/public/index.php index 4e38bc6..ee8f07e 100644 --- a/public/index.php +++ b/public/index.php @@ -1,7 +1,5 @@ +
| + | キューID | +キュー種別 | +利用者 | +定期契約ID | +駐輪場 | +キューコメント | +キューステータス | +コメント | +登録日時 | +更新日時 | +更新オペレータ | +リンク | +
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| + | {{ $job->job_log_id }} | +{{ $job->process_name }} | +{{ $job->job_name }} | +{{ $job->device_id }} | +{{ $job->park_id }} | +{{ $job->status_comment }} | +{{ $job->status }} | +{{ $job->comment }} | +{{ $job->created_at }} | +{{ $job->updated_at }} | +- | +詳細 | +
| + + | +
|---|
|
+
+
+ {{--詳細--}}
+ {{__('編集')}}
+
+ |
+
| + {{__('validation.attributes.user_categoryid')}} + | +{{__('validation.attributes.print_name')}} + | ++ {{__('validation.attributes.usertype_money')}} + | ++ {{__('validation.attributes.usertype_remarks')}} + | +
|---|---|---|---|
| + {{mb_substr($item->user_categoryid, 0, 10)}} | ++ {{mb_substr($item->print_name, 0, 10)}} | ++ {{mb_substr($item->usertype_money, 0, 10)}} | ++ {{mb_substr($item->usertype_remarks, 0, 20)}} | +
| - - | -
|---|
|
-
-
- {{--詳細--}}
- {{__('編集')}}
-
- |
-
-
| - {{__('validation.attributes.user_categoryid')}} - | - - -{{__('validation.attributes.print_name')}} - | - -- {{__('validation.attributes.usertype_money')}} - | - -- {{__('validation.attributes.usertype_remarks')}} - | -|||||
|---|---|---|---|---|---|---|---|---|
| + + + | ++ {{__('利用者分類ID')}} + | ++ {{__('ソート順')}} + | ++ {{__('分類名1')}} + | ++ {{__('分類名2')}} + | ++ {{__('分類名3')}} + | ++ {{__('分類名')}} + | ++ {{__('適用料率')}} + | ++ {{__('備考')}} + | +
| - {{mb_substr($item->user_categoryid, 0, 10)}} | - -- {{mb_substr($item->print_name, 0, 10)}} | - -- {{mb_substr($item->usertype_money, 0, 10)}} | - -- {{mb_substr($item->usertype_remarks, 0, 20)}} | -|||||
|
+
+
+ 編集
+
+ |
+ + {{ mb_substr($item->user_categoryid, 0, 10) }} + | ++ {{ mb_substr($item->sort_order, 0, 10) }} + | ++ {{ mb_substr($item->category_name1, 0, 10) }} + | ++ {{ mb_substr($item->category_name2, 0, 10) }} + | ++ {{ mb_substr($item->category_name3, 0, 10) }} + | ++ {{ mb_substr($item->print_name, 0, 10) }} + | ++ {{ mb_substr($item->usertype_money, 0, 10) }} + | ++ {{ mb_substr($item->usertype_remarks, 0, 20) }} + | +
+ パスワード再発行に関するメールを送信します。登録済みユーザIDおよびメールアドレスを入力してください。 +
+ {{-- ★ここからエラー表示を追加★ --}} + @if ($errors->any()) +新しいパスワードを入力してください。
+ @if ($errors->any()) ++ ログイン画面に戻る +
+