当前位置: 首页>>代码示例>>PHP>>正文


PHP Room::where_del_date方法代码示例

本文整理汇总了PHP中Room::where_del_date方法的典型用法代码示例。如果您正苦于以下问题:PHP Room::where_del_date方法的具体用法?PHP Room::where_del_date怎么用?PHP Room::where_del_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Room的用法示例。


在下文中一共展示了Room::where_del_date方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     Bundle::start('messages');
     $twoweeks = date('Y-m-d', strtotime('+2 weeks'));
     $week = date('Y-m-d', strtotime('+1 weeks'));
     $tomorrow = date('Y-m-d', strtotime('+1 day'));
     $rooms = Room::where_del_date($tomorrow)->or_where('del_date', '=', $week)->or_where('del_date', '=', $twoweeks)->get();
     foreach ($rooms as $room) {
         switch ($room->del_date) {
             case $twoweeks:
                 $expire_date = "over twee weken";
                 break;
             case $week:
                 $expire_date = "over een week";
                 break;
             case $tomorrow:
                 $expire_date = "morgen";
                 break;
         }
         Message::send(function ($message) use($room, $expire_date) {
             $message->to($room->email);
             $message->from('kamers@kamergenood.nl', 'Kamergenood');
             $message->subject('Verleng de kameradvertentie: "' . $room->title . '"');
             $message->body('view: emails.extend');
             $message->body->id = $room->id;
             $message->body->title = $room->title;
             $message->body->url = $room->url;
             $message->body->delkey = $room->delkey;
             $message->body->expire_date = $expire_date;
             $message->html(true);
         });
     }
 }
开发者ID:sanneterpstra,项目名称:Kamergenood,代码行数:33,代码来源:extend.php

示例2: run

 public function run()
 {
     Bundle::start('messages');
     $today = date('Y-m-d');
     $rooms = Room::where_del_date($today)->get();
     foreach ($rooms as $room) {
         Message::send(function ($message) use($room) {
             $message->to($room->email);
             $message->from('kamers@kamergenood.nl', 'Kamergenood');
             $message->subject('Kamer verlopen en verwijderd: "' . $room->title . '"');
             $message->body('view: emails.deleted');
             $message->body->title = $room->title;
             $message->html(true);
         });
         $path_room_folder = getcwd() . '/public_html/img/room/' . $room->id;
         File::rmdir($path_room_folder);
         $room->delete();
     }
 }
开发者ID:sanneterpstra,项目名称:Kamergenood,代码行数:19,代码来源:expired.php


注:本文中的Room::where_del_date方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。