update data to device

This commit is contained in:
2020-10-14 17:21:26 +07:00
parent fd27169e00
commit 37ab48f055
7 changed files with 321 additions and 55 deletions

View File

@@ -150,6 +150,17 @@ class Schedule extends \yii\db\ActiveRecord {
return hexdec("0" . $front . "0" . $back);
}
public static function convertTimeAttr($attr) {
$temp = explode("-", $attr);
$from = $temp[0];
$to = $temp[1];
$fTemp = explode(":", $from);
$front = dechex(intval($fTemp[0]) * 100 + intval($fTemp[1]));
$tTemp = explode(":", $to);
$back = dechex(intval($tTemp[0]) * 100 + intval($tTemp[1]));
return hexdec("0" . $front . "0" . $back);
}
public static function scheduleArray() {
$lists = self::find()->all();
$results = [];