Beispiel #1
0
 /**
  * 更新任务进度
  *
  * @param string $tuduId
  * @param int $percent
  * @return int
  */
 public function updateProgress($tuduId, $uniqueId, $percent)
 {
     /*
     	    if (100 === $percent) {
     	        $status = Dao_Td_Tudu_Tudu::STATUS_DONE;
     	    } elseif ($percent > 0) {
     	        $status = Dao_Td_Tudu_Tudu::STATUS_DOING;
     	    } else {
     	        $status = Dao_Td_Tudu_Tudu::STATUS_UNSTART;
     	    }
     
     $this->_tuduDao->updateTudu($tuduId, array(
         'percent' => $percent,
         'status' => $status
         ));
     */
     $percent = $this->_tuduDao->updateProgress($tuduId, $uniqueId, $percent);
     $this->_tuduDao->calcElapsedTime($tuduId);
     return $percent;
 }