本文整理匯總了PHP中smail::sendAutoSetTopProject方法的典型用法代碼示例。如果您正苦於以下問題:PHP smail::sendAutoSetTopProject方法的具體用法?PHP smail::sendAutoSetTopProject怎麽用?PHP smail::sendAutoSetTopProject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類smail
的用法示例。
在下文中一共展示了smail::sendAutoSetTopProject方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: autoSetTopProject
/**
* Функция автоподьема проектов если в них в течении 2х дней не было ни одного ответа
* Поднимает только 1 раз
*
* @global object $DB
*/
public static function autoSetTopProject()
{
global $DB;
// Старые проекты (больше 7 дней) не повышаем
$sql = "\n SELECT \n p.*, u.email, u.subscr, u.login, u.uname, u.usurname, us.key as unsubscribe_key \n FROM projects p\n LEFT JOIN projects_blocked pb ON pb.project_id = p.id\n INNER JOIN employer u ON u.uid = p.user_id\n INNER JOIN users_subscribe_keys us ON us.uid = u.uid\n WHERE\n pb.id IS NULL AND \n p.strong_top = 0 AND top_to IS NULL AND\n p.post_date = p.create_date AND \n p.create_date + interval '2 days' <= now() AND \n (now() - p.create_date) < '7 days' AND \n p.offers_count = 0 AND \n p.closed = false\n ";
$update = "UPDATE projects SET post_date = post_date + interval '2 days' WHERE id IN (?l)";
$update_projects = $DB->rows($sql);
foreach ($update_projects as $prj) {
$prjid[] = $prj['id'];
}
if ($DB->query($update, $prjid)) {
$smail = new smail();
$smail->sendAutoSetTopProject($update_projects);
}
}