|
|
@@ -1,52 +1,67 @@
|
|
|
<?php
|
|
|
|
|
|
namespace app\shop\controller;
|
|
|
+
|
|
|
use app\common\controller\Frontend;
|
|
|
use app\common\library\CoinRate;
|
|
|
use app\common\model\Config;
|
|
|
|
|
|
-class User extends Frontend{
|
|
|
-
|
|
|
- protected $noNeedLogin = ['findpwd','register','login'];
|
|
|
- protected $noNeedRight = '*';
|
|
|
- protected $layout = '';
|
|
|
-
|
|
|
- public function _initialize()
|
|
|
- {
|
|
|
- parent::_initialize();
|
|
|
- }
|
|
|
+class User extends Frontend
|
|
|
+{
|
|
|
+
|
|
|
+ protected $noNeedLogin = ['findpwd', 'register', 'login'];
|
|
|
+ protected $noNeedRight = '*';
|
|
|
+ protected $layout = '';
|
|
|
+
|
|
|
+ public function _initialize()
|
|
|
+ {
|
|
|
+ parent::_initialize();
|
|
|
+ }
|
|
|
+
|
|
|
function index()
|
|
|
{
|
|
|
$info = db('user')->where(['id' => $this->auth->id])->find();
|
|
|
- $this->view->assign([
|
|
|
+ $loginStu = db('studio')->where(['title' => $this->auth->login_studio])->find();
|
|
|
+ $stuid = isset($loginStu['id'])? $loginStu['id'] : 0;
|
|
|
+ $counts = [
|
|
|
+ 'status1'=> db('trade')->where(['relevant_userid'=>$this->auth->id,'status'=>1,'stuid'=>$stuid])->count('id'),
|
|
|
+ 'status2'=> db('trade')->where(['relevant_userid'=>$this->auth->id,'status'=>2,'stuid'=>$stuid])->count('id'),
|
|
|
+ 'status3'=> db('trade')->where(['relevant_userid'=>$this->auth->id,'status'=>3,'issell'=>[['egt',0],['elt',2]],'stuid'=>$stuid])->count('id'),
|
|
|
+ ];
|
|
|
+ $this->view->assign('counts', $counts);
|
|
|
+ $this->view->assign([
|
|
|
"user" => $info,
|
|
|
]);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
+
|
|
|
function myhost()
|
|
|
{
|
|
|
- $studio=db('studio')->where(['id'=>$this->auth->stuid])->find();
|
|
|
- $total1=db('goods')->where(['stuid'=>$studio['id'],'on_sale'=>1,'on_resale'=>2])->count();
|
|
|
- $total2=db('trade')->where(['status'=>0,'stuid'=>$studio['id']])->count();
|
|
|
+ $studio = db('studio')->where(['id' => $this->auth->stuid])->find();
|
|
|
+ $total1 = db('goods')->where(['stuid' => $studio['id'], 'on_sale' => 1, 'on_resale' => 2])->count();
|
|
|
+ $total2 = db('trade')->where(['status' => 0, 'stuid' => $studio['id']])->count();
|
|
|
$this->view->assign([
|
|
|
"studio" => $studio,
|
|
|
- "total1"=>$total1,
|
|
|
- "total2"=>$total2,
|
|
|
+ "total1" => $total1,
|
|
|
+ "total2" => $total2,
|
|
|
]);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
+
|
|
|
function safecenter()
|
|
|
{
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
+
|
|
|
function xieyi()
|
|
|
{
|
|
|
- $list=db('article')->where(['catid'=>5])->select();
|
|
|
+ $list = db('article')->where(['catid' => 5])->select();
|
|
|
$this->view->assign([
|
|
|
"list" => $list,
|
|
|
]);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 注销登录
|
|
|
*/
|
|
|
@@ -56,93 +71,106 @@ class User extends Frontend{
|
|
|
$this->auth->logout();
|
|
|
$this->redirect("/index/user/login");
|
|
|
}
|
|
|
- function userteam()
|
|
|
- {
|
|
|
- $user=db('user')->where(['id'=>$this->auth->id])->find();
|
|
|
- $total=db('user')->where(['refereeids'=>['like','%,'.$this->auth->id.',%']])->count();
|
|
|
- $total=db('user')->where(['refereeids'=>['like','%,'.$this->auth->id.',%'],'isuser'=>1])->count();
|
|
|
- $today_cnt=db('user')->where(['refereeids'=>['like','%,'.$this->auth->id.',%'],'createtime'=>['gt',strtotime('today')]])->count();
|
|
|
- $today_upload=db('user')->where(['refereeids'=>['like','%,'.$this->auth->id.',%'],'isuser'=>1,'intime'=>['gt',strtotime('today')]])->count();
|
|
|
- $list=db('user')->where(['refereeid'=>$this->auth->id])->select();
|
|
|
- if(empty($list))
|
|
|
- {
|
|
|
- $list=[];
|
|
|
+
|
|
|
+ function userteam()
|
|
|
+ {
|
|
|
+ $user = db('user')->where(['id' => $this->auth->id])->find();
|
|
|
+ $total = db('user')->where(['refereeids' => ['like', '%,' . $this->auth->id . ',%'], 'status' => 1])->count();
|
|
|
+ $total1 = db('user')->where(['refereeids' => ['like', '%,' . $this->auth->id . ',%'], 'isuser' => 1, 'status' => 1])->count();
|
|
|
+ $today_cnt = db('user')->where(['refereeids' => ['like', '%,' . $this->auth->id . ',%'], 'createtime' => ['gt', strtotime('today')], 'status' => 1])->count();
|
|
|
+ $today_upload = db('user')->where(['refereeids' => ['like', '%,' . $this->auth->id . ',%'], 'isuser' => 1, 'intime' => ['gt', strtotime('today')], 'status' => 1])->count();
|
|
|
+ $list = db('user')->where(['refereeid' => $this->auth->id, 'status' => 1])->select();
|
|
|
+ if (empty($list)) {
|
|
|
+ $list = [];
|
|
|
}
|
|
|
- $this->view->assign([
|
|
|
- "list"=>$list,
|
|
|
- "total"=>$total,
|
|
|
- "total1"=>$total,
|
|
|
- "today_cnt"=>$today_cnt,
|
|
|
- 'today_upload'=>$today_upload,
|
|
|
- ]);
|
|
|
- return $this->view->fetch();
|
|
|
+ $this->view->assign([
|
|
|
+ "list" => $list,
|
|
|
+ "total" => $total,
|
|
|
+ "total1" => $total1,
|
|
|
+ "today_cnt" => $today_cnt,
|
|
|
+ 'today_upload' => $today_upload,
|
|
|
+ ]);
|
|
|
+ return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function tjpv()
|
|
|
{
|
|
|
- $uids=db('user')->where(['refereeids'=>['like','%,'.$this->auth->id.',%']])->column('id');
|
|
|
- if($uids)
|
|
|
- {
|
|
|
- $total_nums=db('trade')->where(['status'=>['egt',3],'relevant_userid'=>['in',$uids]])->sum('nums');
|
|
|
- $total_cnt=db('trade')->where(['status'=>['egt',3],'relevant_userid'=>['in',$uids]])->count();
|
|
|
- $totalt_nums=db('trade')->where(['status'=>['egt',3],'create_time'=>strtotime('today'),'relevant_userid'=>['in',$uids]])->sum('nums');
|
|
|
- $totalt_cnt=db('trade')->where(['status'=>['egt',3],'create_time'=>strtotime('today'),'relevant_userid'=>['in',$uids]])->count();
|
|
|
- }else{
|
|
|
- $total_nums=0;
|
|
|
- $total_cnt=0;
|
|
|
- $totalt_nums=0;
|
|
|
- $totalt_cnt=0;
|
|
|
+ $config = Config::getConfigByGroup('trade');
|
|
|
+ $releaseRate = isset($config['release_rate'])? floatval($config['release_rate']['value']) : 0;
|
|
|
+ $this->view->assign('release_rate', $releaseRate);
|
|
|
+ return $this->fetch();
|
|
|
+ }
|
|
|
+
|
|
|
+ function tjpv1()
|
|
|
+ {
|
|
|
+ $uids = db('user')->where(['refereeids' => ['like', '%,' . $this->auth->id . ',%']])->column('id');
|
|
|
+ if ($uids) {
|
|
|
+ $total_nums = db('trade')->where(['status' => ['egt', 3], 'relevant_userid' => ['in', $uids]])->sum('nums');
|
|
|
+ $total_cnt = db('trade')->where(['status' => ['egt', 3], 'relevant_userid' => ['in', $uids]])->count();
|
|
|
+ $totalt_nums = db('trade')->where(['status' => ['egt', 3], 'create_time' => strtotime('today'), 'relevant_userid' => ['in', $uids]])->sum('nums');
|
|
|
+ $totalt_cnt = db('trade')->where(['status' => ['egt', 3], 'create_time' => strtotime('today'), 'relevant_userid' => ['in', $uids]])->count();
|
|
|
+ } else {
|
|
|
+ $total_nums = 0;
|
|
|
+ $total_cnt = 0;
|
|
|
+ $totalt_nums = 0;
|
|
|
+ $totalt_cnt = 0;
|
|
|
}
|
|
|
$this->view->assign([
|
|
|
- "total_nums"=>$total_nums,
|
|
|
- "total_cnt"=>$total_cnt,
|
|
|
- "totalt_nums"=>$totalt_nums,
|
|
|
- "totalt_cnt"=>$totalt_cnt,
|
|
|
+ "total_nums" => $total_nums,
|
|
|
+ "total_cnt" => $total_cnt,
|
|
|
+ "totalt_nums" => $totalt_nums,
|
|
|
+ "totalt_cnt" => $totalt_cnt,
|
|
|
]);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
function sonteam()
|
|
|
{
|
|
|
- $id=input('id');
|
|
|
- $list=db('user')->where(['refereeid'=>$id])->select();
|
|
|
- if(empty($list))
|
|
|
- {
|
|
|
- $list=[];
|
|
|
+ $id = input('id');
|
|
|
+ $list = db('user')->where(['refereeid' => $id])->select();
|
|
|
+ if (empty($list)) {
|
|
|
+ $list = [];
|
|
|
}
|
|
|
$this->view->assign([
|
|
|
- "list"=>$list,
|
|
|
- 'id'=>$id
|
|
|
+ "list" => $list,
|
|
|
+ 'id' => $id
|
|
|
]);
|
|
|
return $this->view->fetch();
|
|
|
|
|
|
}
|
|
|
- function bonusdetailed()
|
|
|
+
|
|
|
+ function bonusdetailed()
|
|
|
{
|
|
|
- $user=db('user')->where(['id'=>$this->auth->id])->find();
|
|
|
- $zt=db('detailed_cash')->where(['userid'=>$this->auth->id,'type'=>16])->sum('money');
|
|
|
- $jt=db('detailed_cash')->where(['userid'=>$this->auth->id,'type'=>20])->sum('money');
|
|
|
- $manager=db('detailed_cash')->where(['userid'=>$this->auth->id,'type'=>['in','17,18']])->sum('money');
|
|
|
+ $user = db('user')->where(['id' => $this->auth->id])->find();
|
|
|
+ $zt = db('detailed_cash')->where(['userid' => $this->auth->id, 'type' => 16])->sum('money');
|
|
|
+ $jt = db('detailed_cash')->where(['userid' => $this->auth->id, 'type' => 20])->sum('money');
|
|
|
+ $manager = db('detailed_cash')->where(['userid' => $this->auth->id, 'type' => ['in', '17,18']])->sum('money');
|
|
|
//今日
|
|
|
- $zt1=db('detailed_cash')->where(['userid'=>$this->auth->id,'type'=>16,'create_time'=>['egt',strtotime('today')]])->sum('money');
|
|
|
- $jt1=db('detailed_cash')->where(['userid'=>$this->auth->id,'type'=>20,'create_time'=>['egt',strtotime('today')]])->sum('money');
|
|
|
- $manager1=db('detailed_cash')->where(['userid'=>$this->auth->id,'type'=>['in','17,18'],'create_time'=>['egt',strtotime('today')]])->sum('money');
|
|
|
+ $zt1 = db('detailed_cash')->where(['userid' => $this->auth->id, 'type' => 16, 'create_time' => ['egt', strtotime('today')]])->sum('money');
|
|
|
+ $jt1 = db('detailed_cash')->where(['userid' => $this->auth->id, 'type' => 20, 'create_time' => ['egt', strtotime('today')]])->sum('money');
|
|
|
+ $manager1 = db('detailed_cash')->where(['userid' => $this->auth->id, 'type' => ['in', '17,18'], 'create_time' => ['egt', strtotime('today')]])->sum('money');
|
|
|
$this->view->assign([
|
|
|
- 'user'=> $user,
|
|
|
- 'zt'=>$zt,
|
|
|
- 'jt'=>$jt,
|
|
|
- 'manager'=>$manager,
|
|
|
- 'zt1'=>$zt1,
|
|
|
- 'jt1'=>$jt1,
|
|
|
- 'manager1'=>$manager1,
|
|
|
+ 'user' => $user,
|
|
|
+ 'zt' => $zt,
|
|
|
+ 'jt' => $jt,
|
|
|
+ 'manager' => $manager,
|
|
|
+ 'zt1' => $zt1,
|
|
|
+ 'jt1' => $jt1,
|
|
|
+ 'manager1' => $manager1,
|
|
|
]);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function xieyidetail()
|
|
|
{
|
|
|
- $id=input('id');
|
|
|
- $info=db('article')->where("id",$id)->find();
|
|
|
- $this->view->assign("info",$info);
|
|
|
+ $id = input('id');
|
|
|
+ $info = db('article')->where("id", $id)->find();
|
|
|
+ $this->view->assign("info", $info);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function sharelink()
|
|
|
{
|
|
|
$user = get_user_data($this->auth->id);
|
|
|
@@ -151,8 +179,8 @@ class User extends Frontend{
|
|
|
$save_path = 'uploads/tj/';
|
|
|
put_file_from_url_content($img_url, $user['id'] . ".png", $save_path);
|
|
|
$this->assign("imgurl", 'http://' . $_SERVER['HTTP_HOST'] . '/uploads/tj/' . $user['id'] . '.png');
|
|
|
- $myset= \app\common\model\Config::getConfigByGroup('Iindex');
|
|
|
- $this->view->assign("shareBg",$myset['share_bg']['value']);
|
|
|
+ $myset = \app\common\model\Config::getConfigByGroup('Iindex');
|
|
|
+ $this->view->assign("shareBg", $myset['share_bg']['value']);
|
|
|
$this->view->assign("tjurl", $tjurl);
|
|
|
$this->view->assign("user", $user);
|
|
|
return $this->view->fetch();
|
|
|
@@ -166,20 +194,22 @@ class User extends Frontend{
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
* @throws \think\exception\DbException
|
|
|
*/
|
|
|
- function material(){
|
|
|
- $lists=db('material')->where(['status'=>1])
|
|
|
+ function material()
|
|
|
+ {
|
|
|
+ $lists = db('material')->where(['status' => 1])
|
|
|
->order('create_time desc,id desc')
|
|
|
->limit(100)
|
|
|
->select();
|
|
|
- if($lists){
|
|
|
- foreach ($lists as &$item){
|
|
|
- $item['images'] = $item['images']? explode(',', $item['images']) : [];
|
|
|
+ if ($lists) {
|
|
|
+ foreach ($lists as &$item) {
|
|
|
+ $item['images'] = $item['images'] ? explode(',', $item['images']) : [];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->view->assign("lists", $lists);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function setting()
|
|
|
{
|
|
|
$user = db('user')->where(['id' => $this->auth->id])->find();
|
|
|
@@ -191,20 +221,22 @@ class User extends Frontend{
|
|
|
* 联系我们
|
|
|
* @return mixed
|
|
|
*/
|
|
|
- function aboutus(){
|
|
|
+ function aboutus()
|
|
|
+ {
|
|
|
$config = Config::getConfigByGroup('basic');
|
|
|
- $about = isset($config['site_about'])? htmlspecialchars_decode($config['site_about']['value']) : '';
|
|
|
+ $about = isset($config['site_about']) ? htmlspecialchars_decode($config['site_about']['value']) : '';
|
|
|
$this->view->assign('about', $about);
|
|
|
- return $this->fetch();
|
|
|
+ return $this->fetch();
|
|
|
}
|
|
|
|
|
|
/*修改资料*/
|
|
|
function updatenickname()
|
|
|
{
|
|
|
- $user=$this->auth->getUserinfo();
|
|
|
- $this->view->assign("user",$user);
|
|
|
+ $user = $this->auth->getUserinfo();
|
|
|
+ $this->view->assign("user", $user);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
/* 流水 */
|
|
|
function detailed()
|
|
|
{
|
|
|
@@ -213,50 +245,57 @@ class User extends Frontend{
|
|
|
$this->view->assign('mate_title', get_detailed_type_text($group));
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function updatepwd1()
|
|
|
{
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function updatepwd2()
|
|
|
{
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function isreal()
|
|
|
{
|
|
|
- $user=db('user')->where(['id'=>$this->auth->id])->find();
|
|
|
- $this->view->assign("user",$user);
|
|
|
+ $user = db('user')->where(['id' => $this->auth->id])->find();
|
|
|
+ $this->view->assign("user", $user);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function profile()
|
|
|
{
|
|
|
- $user=db('user')->where(['id'=>$this->auth->id])->find();
|
|
|
- $this->view->assign("user",$user);
|
|
|
+ $user = db('user')->where(['id' => $this->auth->id])->find();
|
|
|
+ $this->view->assign("user", $user);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function trans()
|
|
|
{
|
|
|
- $user=get_user_data($this->auth->id);
|
|
|
- $this->view->assign("user",$user);
|
|
|
- $this->view->assign("money_type",input('money_type'));
|
|
|
+ $user = get_user_data($this->auth->id);
|
|
|
+ $this->view->assign("user", $user);
|
|
|
+ $this->view->assign("money_type", input('money_type'));
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function transfer()
|
|
|
{
|
|
|
- $user=get_user_data($this->auth->id);
|
|
|
- $this->view->assign("user",$user);
|
|
|
+ $user = get_user_data($this->auth->id);
|
|
|
+ $this->view->assign("user", $user);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function withdraw()
|
|
|
{
|
|
|
$tradeConfig = Config::getConfigByGroup('trade');
|
|
|
- $config['withdraw_min'] = isset($tradeConfig['withdraw_min'])? $tradeConfig['withdraw_min']['value'] : 0;
|
|
|
- $config['withdraw_cap'] = isset($tradeConfig['withdraw_cap'])? $tradeConfig['withdraw_cap']['value'] : 0;
|
|
|
- $config['withdraw_fee'] = isset($tradeConfig['withdraw_fee'])? $tradeConfig['withdraw_fee']['value'] : 0;
|
|
|
- $this->view->assign("config",$config);
|
|
|
- $user=get_user_data($this->auth->id);
|
|
|
- $user['usdt_address_text'] = $user['usdt_address']? substr($user['usdt_address'],0,4).'***'.substr($user['usdt_address'],-4,4) : '';
|
|
|
- $this->view->assign("user",$user);
|
|
|
- $this->view->assign("coinRate",CoinRate::getRate());
|
|
|
+ $config['withdraw_min'] = isset($tradeConfig['withdraw_min']) ? $tradeConfig['withdraw_min']['value'] : 0;
|
|
|
+ $config['withdraw_cap'] = isset($tradeConfig['withdraw_cap']) ? $tradeConfig['withdraw_cap']['value'] : 0;
|
|
|
+ $config['withdraw_fee'] = isset($tradeConfig['withdraw_fee']) ? $tradeConfig['withdraw_fee']['value'] : 0;
|
|
|
+ $this->view->assign("config", $config);
|
|
|
+ $user = get_user_data($this->auth->id);
|
|
|
+ $user['usdt_address_text'] = $user['usdt_address'] ? substr($user['usdt_address'], 0, 4) . '***' . substr($user['usdt_address'], -4, 4) : '';
|
|
|
+ $this->view->assign("user", $user);
|
|
|
+ $this->view->assign("coinRate", CoinRate::getRate());
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
|
|
|
@@ -271,54 +310,66 @@ class User extends Frontend{
|
|
|
function withdraw1()
|
|
|
{
|
|
|
$tradeConfig = Config::getConfigByGroup('trade');
|
|
|
- $config['withdraw_min'] = isset($tradeConfig['withdraw_min'])? $tradeConfig['withdraw_min']['value'] : 0;
|
|
|
- $config['withdraw_cap'] = isset($tradeConfig['withdraw_cap'])? $tradeConfig['withdraw_cap']['value'] : 0;
|
|
|
- $config['withdraw_fee'] = isset($tradeConfig['withdraw_bonus_fee'])? $tradeConfig['withdraw_bonus_fee']['value'] : 0;
|
|
|
- $this->view->assign("config",$config);
|
|
|
- $user=get_user_data($this->auth->id);
|
|
|
- $this->view->assign("user",$user);
|
|
|
- $this->view->assign("coinRate",CoinRate::getRate());
|
|
|
+ $config['withdraw_min'] = isset($tradeConfig['withdraw_min']) ? $tradeConfig['withdraw_min']['value'] : 0;
|
|
|
+ $config['withdraw_cap'] = isset($tradeConfig['withdraw_cap']) ? $tradeConfig['withdraw_cap']['value'] : 0;
|
|
|
+ $config['withdraw_fee'] = isset($tradeConfig['withdraw_bonus_fee']) ? $tradeConfig['withdraw_bonus_fee']['value'] : 0;
|
|
|
+ $this->view->assign("config", $config);
|
|
|
+ $user = get_user_data($this->auth->id);
|
|
|
+ $this->view->assign("user", $user);
|
|
|
+ $this->view->assign("coinRate", CoinRate::getRate());
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function withdrawdetaile()
|
|
|
{
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function withdrawdetaile1()
|
|
|
{
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function releaselog()
|
|
|
{
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function bonuspage()
|
|
|
{
|
|
|
- $user=get_user_data($this->auth->id);
|
|
|
- if($user['stuid']>0)
|
|
|
- {
|
|
|
- $studio=db('studio')->where(['id'=>$user['stuid']])->find();
|
|
|
- $this->view->assign('studio',$studio);
|
|
|
+ $user = get_user_data($this->auth->id);
|
|
|
+ if ($user['stuid'] > 0) {
|
|
|
+ $studio = db('studio')->where(['id' => $user['stuid']])->find();
|
|
|
+ $this->view->assign('studio', $studio);
|
|
|
}
|
|
|
- $total=db('withdrawals')->where(['process_status'=>2,'userid'=>$user['id']])->sum('amount');
|
|
|
- $fensi=db('user')->where(['refereeid'=>$user['id']])->count();
|
|
|
+ $total = db('withdrawals')->where(['process_status' => 2, 'userid' => $user['id']])->sum('amount');
|
|
|
+ $fensi = db('user')->where(['refereeid' => $user['id']])->count();
|
|
|
|
|
|
//var_dump($user);
|
|
|
- $loginStu=db('studio')->where(['title'=>$this->auth->login_studio])->find();
|
|
|
-
|
|
|
+ $loginStu = db('studio')->where(['title' => $this->auth->login_studio])->find();
|
|
|
+ $stuid = isset($loginStu['id'])? $loginStu['id'] : 0;
|
|
|
+ $counts = [
|
|
|
+ 'status1'=> db('trade')->where(['relevant_userid'=>$this->auth->id,'status'=>1,'stuid'=>$stuid])->count('id'),
|
|
|
+ 'status2'=> db('trade')->where(['relevant_userid'=>$this->auth->id,'status'=>2,'stuid'=>$stuid])->count('id'),
|
|
|
+ 'status3'=> db('trade')->where(['relevant_userid'=>$this->auth->id,'status'=>3,'issell'=>[['egt',0],['elt',2]],'stuid'=>$stuid])->count('id'),
|
|
|
+ ];
|
|
|
+ $this->view->assign('counts', $counts);
|
|
|
+
|
|
|
$this->view->assign([
|
|
|
- "user"=>$user,
|
|
|
- 'total'=>$total,
|
|
|
- 'fensi'=>$fensi,
|
|
|
- 'studio'=>$loginStu,
|
|
|
- 'login_studio'=> $this->auth->login_studio,
|
|
|
+ "user" => $user,
|
|
|
+ 'total' => $total,
|
|
|
+ 'fensi' => $fensi,
|
|
|
+ 'studio' => $loginStu,
|
|
|
+ 'login_studio' => $this->auth->login_studio,
|
|
|
]);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function viewwithdraw()
|
|
|
{
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
public function login()
|
|
|
{
|
|
|
if ($this->auth->id) {
|
|
|
@@ -330,20 +381,20 @@ class User extends Frontend{
|
|
|
$keeplogin = (int)$this->request->post('keeplogin');
|
|
|
$token = $this->request->post('__token__');
|
|
|
$rule = [
|
|
|
- 'account' => 'require|length:3,50',
|
|
|
- 'password' => 'require|length:6,30',
|
|
|
+ 'account' => 'require|length:3,50',
|
|
|
+ 'password' => 'require|length:6,30',
|
|
|
'__token__' => 'require|token',
|
|
|
];
|
|
|
|
|
|
$msg = [
|
|
|
- 'account.require' => 'Account can not be empty',
|
|
|
- 'account.length' => 'Account must be 3 to 50 characters',
|
|
|
+ 'account.require' => 'Account can not be empty',
|
|
|
+ 'account.length' => 'Account must be 3 to 50 characters',
|
|
|
'password.require' => 'Password can not be empty',
|
|
|
- 'password.length' => 'Password must be 6 to 30 characters',
|
|
|
+ 'password.length' => 'Password must be 6 to 30 characters',
|
|
|
];
|
|
|
$data = [
|
|
|
- 'account' => $account,
|
|
|
- 'password' => $password,
|
|
|
+ 'account' => $account,
|
|
|
+ 'password' => $password,
|
|
|
'__token__' => $token,
|
|
|
];
|
|
|
$validate = new Validate($rule, $msg);
|
|
|
@@ -364,23 +415,24 @@ class User extends Frontend{
|
|
|
&& !preg_match("/(user\/login|user\/register|user\/logout)/i", $referer)) {
|
|
|
$url = $referer;
|
|
|
}
|
|
|
- $myset=config('site');
|
|
|
- $this->view->assign("logoimg",$myset['web_site_logo']);
|
|
|
+ $myset = config('site');
|
|
|
+ $this->view->assign("logoimg", $myset['web_site_logo']);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 注册会员
|
|
|
*/
|
|
|
public function register()
|
|
|
{
|
|
|
- $code=input('code');
|
|
|
- if(empty($code))
|
|
|
- {
|
|
|
- $code='';
|
|
|
+ $code = input('code');
|
|
|
+ if (empty($code)) {
|
|
|
+ $code = '';
|
|
|
}
|
|
|
- $this->view->assign('code',$code);
|
|
|
+ $this->view->assign('code', $code);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+
|
|
|
function findpwd()
|
|
|
{
|
|
|
return $this->view->fetch();
|