作者 开飞机的舒克
1 个管道 的构建 通过 耗费 3 秒

处理bug:使用时间表中最大的节点去判断

... ... @@ -56,7 +56,7 @@ class Crontab extends Api
foreach ($sid as $item) {
db('tech_status')
->insert([
'date' => $did,
'date' => '01-08',
'time' => $v,
'status' => 1,
'tech_id' => $item,
... ...
... ... @@ -2,6 +2,7 @@
namespace app\common\model;
use app\admin\model\Time;
use app\common\controller\Resource;
use think\Model;
... ... @@ -38,7 +39,9 @@ class SeverSku extends Model
$time1 = strtotime("$yue $time");
$endTime = $time1 + ($mins * 60);
$end_time = date('H:i',$endTime);
if ($end_time > '22:15'){
$maxId = (new Time)->max('id');
$maxTime = (new Time)->where('id',$maxId)->value('time');
if ($end_time > $maxTime){
return false;
}
$status = db('tech_status')->where(['date' => $date, 'tech_id' => $tech_id, 'time' => ['between',[$time,$end_time]]])->column('status');
... ...