Commit 4122181b authored by hujun's avatar hujun

删除单个文件

parent fa196856
<?php
/**
* Description of Autoexec
*
* @author : hujun
* @date : 2018-1-9 14:39:26
* @internal : 自动执行
*/
namespace app\index\controller;
use app\model\HouseInfos;
class Autoexec {
public function exclusiveExpirationTime() {
$house = new HouseInfos();
$house_data = $house->field('id,room_num_left')->where('exclusive_type',1)->where('is_delete',0)->select();
$insert = array();
foreach ($house_data as $k=>$v) {
$insert[$k]['id'] = $v->id;
}
}
public function index() {
$house = new HouseInfos();
$house_data = $house->field('id,room_num_left,exclusive_end')->where('exclusive_type', 1)->where('is_delete', 0)->select();
if ($house_data) {
$insert = array();
foreach ($house_data as $k => $v) {
if (strtotime($v['exclusive_end']. '23:59:59') > time()) {
continue;
}
$insert[$k]['id'] = $v['id'];
$insert[$k]['room_num_left'] = 0;
}
$result = $house->saveAll($insert);
}
return ;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment