作者 耿培杰

修改接口

@@ -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);