order("id desc")->paginate(["list_row" => $limit, "page" => $page])->each(function ($item) { $user = \app\common\model\User::where(["id" => $item["user_id"]])->field("name")->find(); $item["user_name"] = $user->name; return $item; })->toArray(); return $result = ['code' => 0, 'msg' => lang('get info success'), 'data' => $list['data'] ?: [], 'count' => $list['total'] ?: 0]; } return View::fetch(); } /** * 充值审核 */ public function shenhe() { if (Request::isPost()) { $name = input("name"); $page = input("page") ?: 1; $limit = input("limit") ?: 10; $where = []; // if ($name){ // $where["name"]=["like","% $name %"]; // } // $where["type"]=0; $list = GeneralFinance::where($where)->order("status asc,id desc")->paginate(["list_row" => $limit, "page" => $page])->each(function ($item) { $user = \app\common\model\User::where(["id" => $item["user_id"]])->field("name")->find(); $item["user_name"] = $user->name; $item["add_time"]=date("Y-m-d H:i:s",$item["add_time"]); if ($item["status"]==0){ $item["statuss"]="审核中"; }elseif($item["status"]==1){ $item["statuss"]="已通过"; }else{ $item["statuss"]="已拒绝"; } return $item; })->toArray(); return $result = ['code' => 0, 'msg' => lang('get info success'), 'data' => $list['data'] ?: [], 'count' => $list['total'] ?: 0]; } return View::fetch(); } // 审核拒绝general_finance public function jujue() { $id=input("id"); $GeneralFinance=GeneralFinance::where(["id"=>$id])->find(); Message::add_message($GeneralFinance->user_id,1,"充值未通过","您充值".$GeneralFinance->money."通证,审核失败"); GeneralFinance::update(["status"=>2],["id"=>$id]); json_result(200,"设置成功"); } // 充值成功 public function czcg() { $id=input("id"); $bond=GeneralFinance::where(["id"=>$id])->find(); // 给用户加钱 $user=\app\common\model\User::where(["id"=>$bond->user_id])->find(); $money=$user->money+$bond->money; \app\common\model\User::update(["money"=>$money],["id"=>$bond->user_id]); GeneralFinance::update(["status"=>1],["id"=>$id]); Message::add_message($bond->user_id,1,"充值成功","您充值".$bond->money."通证已到账"); // 添加财务日记 Orde::Finance($bond->user_id,"您的充值申请审核通过",$bond->money,0); json_result(200,"设置成功"); } /** * 代理收入 */ public function daili() { if (Request::isPost()) { $name = input("name"); $page = input("page") ?: 1; $limit = input("limit") ?: 10; $where = []; // if ($name){ // $where["name"]=["like","% $name %"]; // } $where["daili"]=1; $list = \app\common\model\Finance::where($where)->order("id desc")->paginate(["list_row" => $limit, "page" => $page])->each(function ($item) { $user = \app\common\model\User::where(["id" => $item["user_id"]])->field("name")->find(); $item["user_name"] = $user->name; return $item; })->toArray(); return $result = ['code' => 0, 'msg' => lang('get info success'), 'data' => $list['data'] ?: [], 'count' => $list['total'] ?: 0]; } return View::fetch(); } /** * 赠送记录 */ public function zhengshon() { if (Request::isPost()) { $name = input("name"); $page = input("page") ?: 1; $limit = input("limit") ?: 10; $where = []; // if ($name){ // $where["name"]=["like","% $name %"]; // } $where["daili"]=2; $list = \app\common\model\Finance::where($where)->order("id desc")->paginate(["list_row" => $limit, "page" => $page])->each(function ($item) { $user = \app\common\model\User::where(["id" => $item["user_id"]])->field("name")->find(); $item["user_name"] = $user->name; return $item; })->toArray(); return $result = ['code' => 0, 'msg' => lang('get info success'), 'data' => $list['data'] ?: [], 'count' => $list['total'] ?: 0]; } return View::fetch(); } }