...
|
...
|
@@ -315,7 +315,7 @@ class Index extends Api |
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function TableList()
|
|
|
public function TableList()
|
|
|
{
|
|
|
$date = input('date');
|
|
|
$day = strtotime(date($date));
|
...
|
...
|
@@ -328,7 +328,8 @@ class Index extends Api |
|
|
->where($map)
|
|
|
->where(['s.cloud_type' => 1])
|
|
|
->where(['s.plane_type' => 1])
|
|
|
->field('t.title,s.id,s.plane_type,s.status,s.user_id')
|
|
|
->join('planename p','p.id=s.plane_type')
|
|
|
->field('t.title,p.name,s.id,s.plane_type,s.status,s.user_id')
|
|
|
->select();
|
|
|
foreach ($shangwu1 as $k => $v) {
|
|
|
if ($v['user_id'] != null) {
|
...
|
...
|
@@ -347,7 +348,8 @@ class Index extends Api |
|
|
->where($map)
|
|
|
->where(['s.cloud_type' => 1])
|
|
|
->where(['s.plane_type' => 2])
|
|
|
->field('s.id as fid,s.plane_type as fplane_type,s.status as fstatus,s.user_id as fuser_id')
|
|
|
->join('planename p','p.id=s.plane_type')
|
|
|
->field('s.id as fid,p.name as fname,s.plane_type as fplane_type,s.status as fstatus,s.user_id as fuser_id')
|
|
|
->select();
|
|
|
foreach ($shangwu2 as $k => $v) {
|
|
|
if ($v['fuser_id'] != null) {
|
...
|
...
|
@@ -371,7 +373,8 @@ class Index extends Api |
|
|
->where($map)
|
|
|
->where(['s.cloud_type' => 2])
|
|
|
->where(['s.plane_type' => 1])
|
|
|
->field('t.title,s.id,s.plane_type,s.status,s.user_id')
|
|
|
->join('planename p','p.id=s.plane_type')
|
|
|
->field('t.title,p.name,s.id,s.plane_type,s.status,s.user_id')
|
|
|
->select();
|
|
|
foreach ($xiawu1 as $k => $v) {
|
|
|
if ($v['user_id'] != null) {
|
...
|
...
|
@@ -390,7 +393,8 @@ class Index extends Api |
|
|
->where($map)
|
|
|
->where(['s.cloud_type' => 2])
|
|
|
->where(['s.plane_type' => 2])
|
|
|
->field('s.id as fid,s.plane_type as fplane_type,s.status as fstatus,s.user_id as fuser_id')
|
|
|
->join('planename p','p.id=s.plane_type')
|
|
|
->field('s.id as fid,p.name as fname,s.plane_type as fplane_type,s.status as fstatus,s.user_id as fuser_id')
|
|
|
->select();
|
|
|
foreach ($xiawu2 as $k => $v) {
|
|
|
if ($v['fuser_id'] != null) {
|
...
|
...
|
@@ -457,7 +461,7 @@ class Index extends Api |
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function Kill()
|
|
|
public function Kill()
|
|
|
{
|
|
|
$id = input('id');
|
|
|
$user_id = $this->is_token($this->request->header());
|
...
|
...
|
@@ -480,19 +484,19 @@ class Index extends Api |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
foreach ($array as $k => $v) {
|
|
|
$kill = Db::name('yuyue')->where(['sun_id' => $v])->where('user_id', $user_id)->find();
|
|
|
if (!empty($kill)) {
|
|
|
if ($kill['type'] == 1) {
|
|
|
Db::name('sun')->where('user_id', $user_id)->where(['id' => $kill['sun_id'] - 1])->update(['user_id' => '', 'status' => 1]);
|
|
|
}
|
|
|
if ($kill['type'] == 2) {
|
|
|
Db::name('sun')->where('user_id', $user_id)->where(['id' => $kill['sun_id'] + 1])->update(['user_id' => '', 'status' => 1]);
|
|
|
}
|
|
|
Db::name('sun')->where('user_id', $user_id)->where('id', $v)->update(['user_id' => '', 'status' => 1]);
|
|
|
Db::name('yuyue')->where(['sun_id' => $v])->where('user_id', $user_id)->delete();
|
|
|
}
|
|
|
}
|
|
|
// foreach ($array as $k => $v) {
|
|
|
// $kill = Db::name('yuyue')->where(['sun_id' => $v])->where('user_id', $user_id)->find();
|
|
|
// if (!empty($kill)) {
|
|
|
// if ($kill['type'] == 1) {
|
|
|
// Db::name('sun')->where('user_id', $user_id)->where(['id' => $kill['sun_id'] - 1])->update(['user_id' => '', 'status' => 1]);
|
|
|
// }
|
|
|
// if ($kill['type'] == 2) {
|
|
|
// Db::name('sun')->where('user_id', $user_id)->where(['id' => $kill['sun_id'] + 1])->update(['user_id' => '', 'status' => 1]);
|
|
|
// }
|
|
|
Db::name('sun')->where('user_id', $user_id)->where('id', $id)->update(['user_id' => '', 'status' => 1]);
|
|
|
Db::name('yuyue')->where(['sun_id' => $id])->where('user_id', $user_id)->delete();
|
|
|
// }
|
|
|
// }
|
|
|
$this->success('成功', 0);
|
|
|
}
|
|
|
|
...
|
...
|
|