...
|
...
|
@@ -2,6 +2,7 @@ |
|
|
|
|
|
namespace app\common\model;
|
|
|
|
|
|
use app\common\controller\Resource;
|
|
|
use think\Model;
|
|
|
|
|
|
class SeverSku extends Model
|
...
|
...
|
@@ -31,49 +32,15 @@ class SeverSku extends Model |
|
|
*/
|
|
|
public function timeLimit($tech_id, $date, $duration, $time)
|
|
|
{
|
|
|
$tech = db('tech_status')->where(['date' => $date, 'tech_id' => $tech_id, 'status' => 0])->column('time');
|
|
|
$mins = db('duration')->where('id', $duration)->value('time');
|
|
|
$year = date('Y', time());
|
|
|
$dates = $date;
|
|
|
$yue = $year . "-" . $dates;
|
|
|
$shi = $time;
|
|
|
$time1 = strtotime("$yue $shi");
|
|
|
$time2 = $time1 + ($mins * 60);
|
|
|
$t1 = date('H:i', $time1);
|
|
|
$t2 = date('H:i', $time2);
|
|
|
//判断是否有间隔
|
|
|
$ti1 = $time1 + 15 * 60;
|
|
|
$tis1 = date('H:i', $ti1);
|
|
|
$ti2 = $time1 + 30 * 60;
|
|
|
$tis2 = date('H:i', $ti2);
|
|
|
$ti3 = $time1 + 45 * 60;
|
|
|
$tis3 = date('H:i', $ti3);
|
|
|
$ti4 = $time1 + 60 * 60;
|
|
|
$tis4 = date('H:i', $ti4);
|
|
|
$ti5 = $time1 + 75 * 60;
|
|
|
$tis5 = date('H:i', $ti5);
|
|
|
$ti6 = $time1 + 90 * 60;
|
|
|
$tis6 = date('H:i', $ti6);
|
|
|
$t3 = null;
|
|
|
if (in_array($tis1, $tech)) {
|
|
|
$t3 = $t2;
|
|
|
}
|
|
|
if (in_array($tis2, $tech)) {
|
|
|
$t3 = $t2;
|
|
|
}
|
|
|
if (in_array($tis3, $tech)) {
|
|
|
$t3 = $t2;
|
|
|
}
|
|
|
if (in_array($tis4, $tech)) {
|
|
|
$t3 = $t2;
|
|
|
}
|
|
|
if (in_array($tis5, $tech)) {
|
|
|
$t3 = $t2;
|
|
|
}
|
|
|
if (in_array($tis6, $tech)) {
|
|
|
$t3 = $t2;
|
|
|
}
|
|
|
return $t3;
|
|
|
$yue = $year . "-" . $date;
|
|
|
$time1 = strtotime("$yue $time");
|
|
|
$endTime = $time1 + ($mins * 60);
|
|
|
$end_time = date('H:i',$endTime);
|
|
|
$status = db('tech_status')->where(['date' => $date, 'tech_id' => $tech_id, 'time' => ['between',[$time,$end_time]]])->column('status');
|
|
|
$bool = (new Resource())::areAllValuesSame($status);
|
|
|
return $bool;
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|