|
@@ -201,31 +201,13 @@ class AdminLightOrderController extends AdminBaseController |
|
@@ -201,31 +201,13 @@ class AdminLightOrderController extends AdminBaseController |
201
|
if (empty($id)) {
|
201
|
if (empty($id)) {
|
202
|
$id = $this->request->param('id');
|
202
|
$id = $this->request->param('id');
|
203
|
}
|
203
|
}
|
204
|
- $data = Db::name('temple_area')->where('id', $id)->find();
|
|
|
205
|
- $arr = [];
|
|
|
206
|
- for ($r = 1; $r <= $data['rows']; $r++) {
|
|
|
207
|
- for ($c = 1; $c <= $data['columns']; $c++) {
|
|
|
208
|
- array_push($arr, [$r,$c]);
|
204
|
+ if (empty($lightId)){
|
|
|
205
|
+ $lightId=$this->request->param('lightId');
|
209
|
}
|
206
|
}
|
210
|
- }
|
|
|
211
|
- $is_set = Db::name('light_order')
|
|
|
212
|
- ->alias('lo')
|
|
|
213
|
- ->join('light l', 'lo.light_id=l.id')
|
|
|
214
|
- ->where(['l.area_id' => $id, 'lo.status' => 1, 'lo.end_time' => ['>', time()]])->field('l.row,l.column')->select()->toArray();
|
|
|
215
|
- if (!empty($lightId)) {
|
|
|
216
|
- $is_set = Db::name('light_order')
|
207
|
+ $data = Db::name('light_order')
|
217
|
->alias('lo')
|
208
|
->alias('lo')
|
218
|
->join('light l', 'lo.light_id=l.id')
|
209
|
->join('light l', 'lo.light_id=l.id')
|
219
|
->where(['l.area_id' => $id, 'lo.status' => 1, 'lo.end_time' => ['>', time()], 'l.id' => ['neq', $lightId]])->field('l.row,l.column')->select()->toArray();
|
210
|
->where(['l.area_id' => $id, 'lo.status' => 1, 'lo.end_time' => ['>', time()], 'l.id' => ['neq', $lightId]])->field('l.row,l.column')->select()->toArray();
|
220
|
- }
|
|
|
221
|
- foreach ($arr as $k=>$v){
|
|
|
222
|
- foreach ($is_set as $k1=>$v1){
|
|
|
223
|
- if (array_values($v)==array_values($v1)){
|
|
|
224
|
- unset($arr[$k]);
|
|
|
225
|
-// $arr = array_values($arr);
|
|
|
226
|
- }
|
|
|
227
|
- }
|
|
|
228
|
- }
|
|
|
229
|
- return json_encode($arr);
|
211
|
+ return json_encode($data);
|
230
|
}
|
212
|
}
|
231
|
} |
213
|
} |