Changeset View
Changeset View
Standalone View
Standalone View
application/modules/default/models/Project.php
Show First 20 Lines • Show All 2091 Lines • ▼ Show 20 Line(s) | 24 | { | |||
---|---|---|---|---|---|
2092 | 2092 | | |||
2093 | /** | 2093 | /** | ||
2094 | * @param $project_id | 2094 | * @param $project_id | ||
2095 | * @return true/false | 2095 | * @return true/false | ||
2096 | * @throws Zend_Db_Statement_Exception | 2096 | * @throws Zend_Db_Statement_Exception | ||
2097 | */ | 2097 | */ | ||
2098 | public function validateDeleteProjectFromSpam($project_id) | 2098 | public function validateDeleteProjectFromSpam($project_id) | ||
2099 | { | 2099 | { | ||
2100 | //produkt ist ueber 6 monate alt oder produkt hat ueber 5 kommentare oder produkt hat minimum 1 pling | 2100 | // A product older than 6 months, with more than 5 comments or with at least 1 pling can not be deleted. | ||
2101 | // darf nicht gelöscht werden | | |||
2102 | $sql ='select count_comments | 2101 | $sql ='select count_comments | ||
2103 | ,created_at | 2102 | ,created_at | ||
2104 | , (created_at+ INTERVAL 6 MONTH < NOW()) is_old | 2103 | , (created_at+ INTERVAL 6 MONTH < NOW()) is_old | ||
2105 | ,(select count(1) from project_plings f where f.project_id = p.project_id and f.is_deleted = 0) plings | 2104 | ,(select count(1) from project_plings f where f.project_id = p.project_id and f.is_deleted = 0) plings | ||
2106 | FROM project p where project_id =:project_id'; | 2105 | FROM project p where project_id =:project_id'; | ||
2107 | $result = $this->_db->fetchRow($sql, array( | 2106 | $result = $this->_db->fetchRow($sql, array( | ||
2108 | 'project_id' => $project_id, | 2107 | 'project_id' => $project_id, | ||
2109 | )); | 2108 | )); | ||
Show All 11 Lines |