del_Ins_MisCardIns.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /*
  3. * To change this license header, choose License Headers in Project Properties.
  4. * To change this template file, choose Tools | Templates
  5. * and open the template in the editor.
  6. */
  7. /**
  8. * Description of MisCardIns
  9. * 任务卡实例
  10. * @author jgao
  11. */
  12. class MisCardIns {
  13. //put your code here
  14. /**
  15. * 实例id
  16. * @var type
  17. */
  18. public $id = 0;
  19. /**
  20. * 模板id
  21. * @var type
  22. */
  23. public $tid = 0;
  24. /**
  25. * 任务卡状态
  26. * @var type
  27. */
  28. public $state = 0;
  29. /**
  30. * 当前时间戳
  31. * @var type
  32. */
  33. public $ts = 0;
  34. /**
  35. * 任务卡状态
  36. */
  37. public function getState(){
  38. if($this->state != MissionCardStateType::ing){
  39. return $this->state;
  40. }
  41. $mo = dataCenter()->getMissionCardData($this->tid);
  42. $misslist = strsplit_raw($mo->misslist);
  43. $missInfo = usrInfo()->missInfo();
  44. $bSign = true;
  45. foreach ($misslist as $missId){
  46. if(!$missInfo->onceFinished($missId)){
  47. $bSign = false;
  48. break;
  49. }
  50. }
  51. if($bSign){
  52. $this->state = MissionCardStateType::finish;
  53. }
  54. return $this->state;
  55. }
  56. }