diff --git a/application/cron/controller/Test.php b/application/cron/controller/Test.php index 5152266..e504de0 100644 --- a/application/cron/controller/Test.php +++ b/application/cron/controller/Test.php @@ -128,4 +128,29 @@ class Test } } + public function RoomOwners() + { + $room = Db::name('vs_room')->where(['room_status' => 1,'apply_status' => 2])->select(); + $arr = []; + foreach ($room as $key => $value) { + $liushui = Db::name('vs_give_gift')->where(['from_id' => $value['id'],'from' => 2])->sum('total_price'); + $usercode = Db::name('user')->where(['id' => $value['user_id']])->value('user_code'); + $nickname = Db::name('user')->where(['id' => $value['user_id']])->value('nickname'); + $arr[] = [ + 'room_id' => $value['id'], + 'user_id' => $value['user_id'], + 'user_code' => $usercode, + 'nickname' => $nickname, + 'liushui' => $liushui + ]; + } + + //房主的收益 + foreach ($arr as $key => $v){ + $shouyi = db::name('vs_user_money_log')->where(['user_id' => $v['user_id'],'change_type' => 18,'money_type' =>2,'createtime'=>['<',1759585380]])->sum('change_value'); + $arr[$key]['shouyi'] = $shouyi; + } + var_dump($arr); + } + } \ No newline at end of file