CrontadstatusDao.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. class CrontadstatusDao {
  3. public $id;
  4. public $cid;
  5. public $uid;
  6. public $status;
  7. public $time;
  8. public $_table = 'zhask_crontad_status';
  9. public $_primarykey = "id";
  10. public $_fields = array ('id', 'cid', 'uid', 'status', 'time' );
  11. /**
  12. * 获取任务进行状态
  13. * @param unknown_type $uid
  14. * @param unknown_type $mission_type
  15. */
  16. public function get_crontab_status($uid = 0, $mission_type = 0) {
  17. $sql = "select * from " . t_crontadstatus . " where uid = " . $uid . " and cid=" . $mission_type;
  18. $query = Doo::db ()->query ( $sql );
  19. $result = $query->fetch ();
  20. return $result;
  21. }
  22. /**
  23. * 完成任务
  24. * @param unknown_type $uid
  25. * @param unknown_type $mission_type
  26. */
  27. public function complete_crontab($uid = 0, $mission_type = 0) {
  28. $sql = "UPDATE " . t_crontadstatus . " SET status = ".COMPLETE." , time =".get_date()." WHERE uid = " . $uid." and cid=".$mission_type;
  29. $query = Doo::db ()->query ( $sql );
  30. }
  31. /**
  32. * 接受任务
  33. * @param unknown_type $uid
  34. * @param unknown_type $mission_type
  35. */
  36. public function add_crontab($uid, $mission_type) {
  37. }
  38. /**
  39. * 删除完成任务
  40. */
  41. public function delete_crontab() {
  42. $sql = "delete from " . t_question . " where id in ( " . $id . " )";
  43. Doo::db ()->query ( $sql );
  44. }
  45. }
  46. ?>