正在显示
1 个修改的文件
包含
1 行增加
和
0 行删除
@@ -136,6 +136,7 @@ class Sundry extends Api | @@ -136,6 +136,7 @@ class Sundry extends Api | ||
136 | if (!empty($params['county_id'])) $where['county_id'] = $params['county_id']; | 136 | if (!empty($params['county_id'])) $where['county_id'] = $params['county_id']; |
137 | 137 | ||
138 | $data = $model->where($where)->field('is_special,starttime1,endtime1,starttime2,endtime2')->find(); | 138 | $data = $model->where($where)->field('is_special,starttime1,endtime1,starttime2,endtime2')->find(); |
139 | + if (!$data) $data = $model->where(['province_id'=>$params['province_id']])->field('is_special,starttime1,endtime1,starttime2,endtime2')->find(); | ||
139 | $startDate = date("Y-m-d", strtotime('+' . $data['starttime1'] . ' days', time())); | 140 | $startDate = date("Y-m-d", strtotime('+' . $data['starttime1'] . ' days', time())); |
140 | $endDate = date("Y-m-d", strtotime('+' . $data['endtime1'] . ' days', time())); | 141 | $endDate = date("Y-m-d", strtotime('+' . $data['endtime1'] . ' days', time())); |
141 | $data['date'] = period_date($startDate, $endDate); | 142 | $data['date'] = period_date($startDate, $endDate); |
-
请 注册 或 登录 后发表评论