作者 wangzhi

xiugai

... ... @@ -565,12 +565,16 @@ class Yuyue extends Api
$SunInfo = Db::name('sun')->field('s.*')->alias('s')->join('plane p', 'p.id=s.plane_id')->where('p.base_id', $Params['base_id'])->where($Map)->select();
if (!empty($SunInfo)) foreach ($SunInfo as $k => $v) {
if (($this->TimeCrcle($v['id']) > strtotime($Params['start_time'] . ':00') - 1) && ($this->TimeCrcle($v['id']) < strtotime($Params['end_time'] . ':00'))) {
/*发送短信*/
$Bool = $this->Send($v['user_id'], $v['id']);
if ($Params['status'] == 1) {
$User = \app\common\model\User::get($v['user_id']);
$this->SendSms($User->mobile, '【华北飞行基地】' . $Params['con'] . '空域情况:' . $Params['kong']);
}
/*修改预约列表*/
Db::name('sun')->where('id', $v['id'])->update(['status' => 1, 'updatetime' => time()]);
}
}
/*发送短信*/
if ($Params['status'] == 1) {
$User = Db::name('user')->where('status', 0)->field('id as user_id,mobile')->select();
foreach ($User as $k => $v) {
// $Bool = $this->Send($v['user_id'], $v['id']);
$this->SendSms($v['mobile'], '【华北飞行基地】' . $Params['con'] . '空域情况:' . $Params['kong']);
}
}
$this->success('成功', 1);
... ...