Index.php 861 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\talent\controller;
  3. use app\common\model\TalentWorkModel;
  4. use app\talent\TalentBaseController;
  5. class Index extends TalentBaseController
  6. {
  7. public function index()
  8. {
  9. $month = date('Y-m');
  10. $is_register = 'false';
  11. $work_check = TalentWorkModel::where('month', $month)->where('user_id', $this->user->id)->find();
  12. if (!empty($work_check)) {
  13. $is_register = 'true';
  14. }
  15. return view('', [
  16. 'is_register' => $is_register,
  17. 'month' => $month,
  18. ]);
  19. }
  20. public function listWork()
  21. {
  22. $list = TalentWorkModel::where('user_id', $this->user->id)
  23. ->limit(input('limit', 10))
  24. ->order('update_time', 'desc')
  25. ->page(input('page', 1))
  26. ->select();
  27. ajax_success($list);
  28. }
  29. }