...
|
...
|
@@ -18,6 +18,17 @@ class Crontab extends Api |
|
|
*/
|
|
|
public function index()
|
|
|
{
|
|
|
//删除今天之前的日期
|
|
|
$today = date('m-d', time());
|
|
|
db('date')->where('date', 'lt', $today)->delete();
|
|
|
|
|
|
//删除技师中今天之前的时间
|
|
|
$time = date( 'm-d', time());
|
|
|
db('tech_status')->where('date','lt',$time)->delete();
|
|
|
//删除操作日志
|
|
|
db('admin_log')->where('createtime','lt',time())->delete();
|
|
|
|
|
|
//新增日期
|
|
|
$day = date('m-d', strtotime('+13 day'));
|
|
|
$week = date('w', strtotime('+13 day'));
|
|
|
$id = db('date')->insertGetId([
|
...
|
...
|
@@ -27,29 +38,7 @@ class Crontab extends Api |
|
|
]);
|
|
|
$this->success('',$id);
|
|
|
}
|
|
|
/**
|
|
|
* 删除日期[date表]
|
|
|
*/
|
|
|
public function delDate(){
|
|
|
if ('22:30' < '22:15'){
|
|
|
dump(111);
|
|
|
}
|
|
|
exit();
|
|
|
$today = date('m-d', time());
|
|
|
db('date')->where('date', 'lt', $today)->delete();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除时间[tech_status表]
|
|
|
*/
|
|
|
public function delTime(){
|
|
|
//删除时间
|
|
|
$time = date( 'm-d', time());
|
|
|
db('tech_status')->where('date','lt',$time)->delete();
|
|
|
//删除操作日志
|
|
|
db('admin_log')->where('createtime','lt',time())->delete();
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 技师状态[tech_status表]
|
...
|
...
|
@@ -59,8 +48,6 @@ class Crontab extends Api |
|
|
//获取时间
|
|
|
$time = date('m-d', strtotime('+13 day'));
|
|
|
$did = db('date')->where('date', 'egt', $time)->value('date');
|
|
|
//halt($did);
|
|
|
// $did = db('date')->column('date');
|
|
|
$sid = db('tech')->column('id');
|
|
|
$tid = db('time')->column('time');
|
|
|
foreach ($tid as $v) {
|
...
|
...
|
@@ -75,6 +62,7 @@ class Crontab extends Api |
|
|
]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|