/** * 关闭图度(同done,但不添加已完成标签) * * @param int $tuduId * @param boolean $isClose * @return boolean */ public function closeTudu($tuduId, $isClose) { $params = array('isdone' => $isClose); if (!$isClose) { $params['lastposttime'] = time(); } $ret = $this->_tuduDao->updateTudu($tuduId, $params); if (!$ret) { $this->_message = 'update tudu failure'; return false; } $users = $this->_tuduDao->getUsers($tuduId); // 移除图度箱标签,添加已完成 $func = $isClose ? 'deleteLabel' : 'addLabel'; foreach ($users as $user) { $this->_tuduDao->{$func}($tuduId, $user['uniqueid'], '^i'); } return true; }