...
|
...
|
@@ -201,31 +201,13 @@ class AdminLightOrderController extends AdminBaseController |
|
|
if (empty($id)) {
|
|
|
$id = $this->request->param('id');
|
|
|
}
|
|
|
$data = Db::name('temple_area')->where('id', $id)->find();
|
|
|
$arr = [];
|
|
|
for ($r = 1; $r <= $data['rows']; $r++) {
|
|
|
for ($c = 1; $c <= $data['columns']; $c++) {
|
|
|
array_push($arr, [$r,$c]);
|
|
|
}
|
|
|
if (empty($lightId)){
|
|
|
$lightId=$this->request->param('lightId');
|
|
|
}
|
|
|
$is_set = Db::name('light_order')
|
|
|
->alias('lo')
|
|
|
->join('light l', 'lo.light_id=l.id')
|
|
|
->where(['l.area_id' => $id, 'lo.status' => 1, 'lo.end_time' => ['>', time()]])->field('l.row,l.column')->select()->toArray();
|
|
|
if (!empty($lightId)) {
|
|
|
$is_set = Db::name('light_order')
|
|
|
$data = Db::name('light_order')
|
|
|
->alias('lo')
|
|
|
->join('light l', 'lo.light_id=l.id')
|
|
|
->where(['l.area_id' => $id, 'lo.status' => 1, 'lo.end_time' => ['>', time()], 'l.id' => ['neq', $lightId]])->field('l.row,l.column')->select()->toArray();
|
|
|
}
|
|
|
foreach ($arr as $k=>$v){
|
|
|
foreach ($is_set as $k1=>$v1){
|
|
|
if (array_values($v)==array_values($v1)){
|
|
|
unset($arr[$k]);
|
|
|
// $arr = array_values($arr);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return json_encode($arr);
|
|
|
return json_encode($data);
|
|
|
}
|
|
|
} |
...
|
...
|
|