本文整理汇总了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);
}
}