Beispiel #1
0
 public function actionGindex()
 {
     Utils::ensureOpenId();
     $openId = Yii::$app->request->get('open_id');
     if (($usermodel = UcenterMember::findOne(['openid' => $openId])) !== null) {
         Yii::$app->user->login($usermodel);
     } elseif (empty(Yii::$app->user->id)) {
         return $this->redirect(['site/signin']);
     }
     $uid = yii::$app->user->id;
     $gold = Gold::find()->select('uid,sum(money) as smoney')->where(['uid' => $uid])->asArray()->one();
     $allgold = Gold::find()->select('uid,rid,sum(money) as smoney')->where(['uid' => $uid])->asArray()->groupBy('rid')->all();
     $invitation_code = UcenterMember::findIdentity($uid)->invitation_code;
     $goldincome = Income::find()->select('member_id,sum(goldincome) as sincome')->where(['member_id' => $uid])->asArray()->one();
     $jssdk = new Jssdk('wx32814d588c44c17c', '23b0f218574551f18db1dc991dbee87f');
     $signpack = $jssdk->getSignPackage();
     return $this->view('gindex', compact('gold', 'allgold', 'goldincome', 'invitation_code', 'signpack'));
 }
Beispiel #2
0
<?php

use yii\helpers\Html;
use common\models\base\fund\Income;
use common\models\setting\Setting;
use common\models\base\asset\Info;
/* @var $this \yii\web\View */
/* @var $content string */
$directoryAsset = Yii::$app->assetManager->getPublishedUrl('@almasaeed/');
//收益数据包
if (!yii::$app->user->isGuest) {
    $income_array = Income::find()->where("created_at>=" . strtotime(date("Y-m-d")) . " AND member_id=" . yii::$app->user->id)->asArray()->one();
    $profit = Info::findOne(['member_id' => yii::$app->user->id])->profit;
    $income_total = Info::findOne(['member_id' => yii::$app->user->id])->total_revenue;
} else {
    $income_array = "";
    $profit = "";
    $income_total = "";
}
// footer数据表
try {
    $tel1 = Setting::findOne(['code' => 'phone'])->value;
    $tel2 = Setting::findOne(['code' => 'tell'])->value;
    $email = Setting::findOne(['code' => 'email'])->value;
    $work = Setting::findOne(['code' => 'work'])->value;
} catch (ErrorException $e) {
    $tel1 = "";
    $tel2 = "";
    $email = "";
    $work = "";
}
 private static function datas()
 {
     $uid = yii::$app->user->id;
     $model = UcenterMember::find()->where(['id' => Yii::$app->user->id])->one();
     //个人账户
     $model_asset = Info::find()->where(['member_id' => Yii::$app->user->id])->one();
     if (!isset($model_asset)) {
         //跳转至绑定银行卡
         echo "<script>alert('您还没有绑定银行卡');</script>";
         echo "<script>location.href='" . \yii\helpers\Url::to(['money/bindcard']) . "'</script>";
         exit;
     }
     //收益总额
     $income_total = $model_asset->total_revenue;
     //当前收益
     $income_current = $model_asset->profit;
     //昨日收益
     try {
         $income_yesterday = Income::find()->where(['member_id' => yii::$app->user->id, 'created_at' => strtotime(date('Y-m-d', time()))])->one()->smoney;
     } catch (ErrorException $e) {
         $income_yesterday = 0;
     }
     //  		 体验金
     $experience_money = 0;
     $money = Gold::find()->where(['<', 'created_at', time()])->andWhere(['>', 'end_at', time()])->andWhere(['uid' => $uid, 'status' => Gold::STATUS_ACTIVE])->sum('money');
     if ($money) {
         $experience_money = sprintf("%.2f", $money);
     }
     //投资总额
     $invest_total = 0;
     $model_order = Order::find()->where(['member_id' => Yii::$app->user->id, 'status' => 1])->all();
     if (count($model_order) > 0) {
         foreach ($model_order as $K => $V) {
             $invest_total += $V->money;
         }
     }
     //用户投资记录
     $query1 = (new Query())->select("A.step,A.create_at,B.title")->from("asset_log AS A")->where('A.member_id=' . Yii::$app->user->id . " AND A.action='Invest/invest' AND A.status=2 ")->join("left join", "fund_product AS B", "A.product_id=B.id")->orderBy("A.id DESC");
     $pages = new Pagination(['totalCount' => $query1->count(), 'pageSize' => '10']);
     $array_investlog = $query1->offset($pages->offset)->limit($pages->limit)->all();
     $pages_offset = $pages->offset;
     //用户交易记录
     $query2 = Log::find()->where(['member_id' => Yii::$app->user->id, 'status' => [1, 2, 3, 4]]);
     $pages_trade = new Pagination(['totalCount' => $query2->count(), 'pageSize' => '2']);
     $array_tradelog = $query2->offset($pages_trade->offset)->limit($pages_trade->limit)->orderBy("id DESC")->all();
     $pages_trade_offset = $pages_trade->offset;
     //当前投资记录
     $query3 = (new Query())->select("A.step,A.create_at,B.title")->from("asset_log AS A")->where('A.member_id=' . Yii::$app->user->id . " AND A.action='Invest/invest' AND A.status=2 ")->join("left join", "fund_product AS B", "A.product_id=B.id")->limit(4)->orderBy("A.id DESC")->createCommand();
     $invest_log = $query3->queryAll();
     //数据包变量
     $amount_total = $model_asset->balance + $invest_total + $income_current;
     $session = yii::$app->session;
     $session->open();
     if (isset($session['last_time'])) {
         $updated_at = $session['last_time'];
     } else {
         $updated_at = $model->updated_at;
     }
     $phone = $model->phone;
     $balance = $model_asset->balance;
     $freeze = $model_asset->freeze;
     return $infos_rar = compact("invest_total", "income_total", "amount_total", "updated_at", "phone", "balance", "freeze", "invest_log", "array_investlog", "array_tradelog", "pages", "pages_trade", "pages_offset", "pages_trade_offset", "income_current", "income_yesterday", "experience_money");
 }
Beispiel #4
0
 /**
  * 获取用户的详细信息--认证信息--账户信息
  * @param $uid
  * @return array|null|\yii\db\ActiveRecord
  */
 public static function getUserInfo($uid)
 {
     $year_rate = '0.08';
     //活动期间利率调整TODO
     date_default_timezone_set('PRC');
     //活动开始时间
     $begin_time = strtotime('2015-9-24');
     //活动结束时间
     $end_time = strtotime('2015-9-30');
     //当前时间
     $now_time = time();
     if ($now_time > $begin_time && $now_time < $end_time) {
         $year_rate = '0.0815';
     }
     $yes_money = 0;
     $info = UcenterMember::find()->joinWith('info')->select(['id', 'ucenter_member.status', 'lock', 'invitation_code', 'phone', 'idcard', 'real_name', 'bank_card', 'bank_card_phone', 'balance', 'total_invest', 'invest', 'profit', 'total_revenue'])->where(['id' => $uid])->asArray()->one();
     if ($info == null) {
         $return = array('errorNum' => '1', 'errorMsg' => '用户不存在', 'data' => null);
         return $return;
     }
     //获取网站配置信息
     $config = AssetConfig::find()->select(['id', 'deposit_num', 'deposit_min', 'deposit_max', 'deposit_time', 'invest_num', 'invest_min', 'invest_max', 'invest_time', 'withdraw_num', 'withdraw_min', 'withdraw_max', 'withdraw_time', 'ransom_num', 'ransom_min', 'ransom_max', 'ransom_time'])->where(['id' => '2'])->asArray()->one();
     //获取用户昨日收益金额
     //今日零时时间
     $zero_time = strtotime(date("Y-m-d"));
     //获取昨日收益
     $get_yes_money = Income::find()->where(['>', 'created_at', $zero_time])->andWhere(['member_id' => $uid])->one();
     //获取昨日收益金额--利率
     $yes_experience_money = 0;
     if ($get_yes_money) {
         $yes_money = $get_yes_money->smoney ? $get_yes_money->smoney : 0;
         $year_rate = $get_yes_money->rate ? $get_yes_money->rate : 0;
         $yes_experience_money = $get_yes_money->goldincome ? $get_yes_money->goldincome : 0;
     }
     //获取体验金
     $experience_money = 0;
     $money = Gold::find()->where(['<', 'created_at', time()])->andWhere(['>', 'end_at', time()])->andWhere(['uid' => $uid, 'status' => Gold::STATUS_ACTIVE])->sum('money');
     if ($money) {
         $experience_money = sprintf("%.2f", $money);
     }
     //获取活动红包可用金额
     $red_packet_money = 0;
     $red_money = member::get_user_red_packet($uid);
     if (!$red_money['errorNum']) {
         $red_packet_money = $red_money['data']['red_sum'];
     }
     $activity_invite = '';
     //用户再投资金大于一元,可以进行分享
     //        $invest = $info['invest'] ? $info['invest'] : 0;
     //        if($invest >= 1){
     //            $activity_invite = AloneMethod::encrypt($info['phone']);
     //        }
     $activity_invite = AloneMethod::encrypt($info['phone']);
     $data = array('phone' => $info['phone'], 'idcard' => $info['idcard'], 'real_name' => $info['real_name'], 'status' => $info['status'], 'lock' => $info['lock'], 'invitation_code' => $info['invitation_code'], 'bank_card' => $info['bank_card'], 'bank_card_phone' => $info['bank_card_phone'], 'balance' => $info['balance'], 'total_invest' => $info['total_invest'], 'total_revenue' => $info['total_revenue'], 'invest' => $info['invest'], 'profit' => $info['profit'], 'yesterday_rate' => sprintf("%.4f", $year_rate), 'yesterday_money' => $yes_money, 'experience_money' => $experience_money, 'yes_experience_money' => $yes_experience_money, 'red_packet_money' => $red_packet_money, 'activity_invite' => $activity_invite, 'config' => $config);
     $return = array('errorNum' => '0', 'errorMsg' => 'success', 'data' => $data);
     return $return;
 }
Beispiel #5
0
 public function actionIncomelog()
 {
     $uid = yii::$app->user->id;
     //收益记录
     try {
         $incomelog = AloneMethod::profit_log($uid, 1, 15);
     } catch (ErrorException $ex) {
         $incomelog = '';
     }
     $incomelog_pages = Income::find()->select(['smoney', 'created_at'])->where(['member_id' => $uid])->asArray()->all();
     $incomelog_pages = ceil(count($incomelog_pages) / 15);
     return $this->view('incomelog', compact('incomelog', 'incomelog_pages'));
 }
 public function actionIndex()
 {
     error_reporting(0);
     //取出后台设置最大红包
     $maxincome = Setting::getCode('maxincome');
     //取出后台设置的每人最大红白
     $maxpeople = Setting::getCode('maxpeople');
     //后台设置体验金利率
     $goldrate = Setting::getCode('goldrate');
     //设定时区
     date_default_timezone_set('PRC');
     //取出当前时间
     $btime = date('Y-m-d' . '00:00:00', time());
     //转换成“开始”的时间戳
     $btimestr = strtotime($btime);
     //
     //判定今日是否已经计算了收益---防止收益被多次计算
     $count = Income::find()->where(['>', 'created_at', $btimestr])->count();
     if ($count) {
         return '收益已经计算过了';
     }
     //查询昨天以前所有的投资订单,查询order表
     $order = Order::find()->select('member_id,sum(money) as smoney,product_id')->andWhere(['<', 'start_at', Utils::alldaytostr($btimestr)[1]])->andWhere(['status' => 1])->groupBy(['member_id', 'product_id'])->asArray()->all();
     $arrnew = array();
     //循环所有投资
     //        $test = 0;
     foreach ($order as $k => $v) {
         //查询订单下对应项目
         $product = Product::findOne($v['product_id']);
         //查询昨天的生成的利息
         $income = Income::find()->andWhere(['member_id' => $v['member_id']])->andWhere(['between', 'created_at', Utils::alldaytostr($btimestr)[0], Utils::alldaytostr($btimestr)[1]])->one();
         //查询增值卡昨天信息
         //            $railscard = RaiseCard::find()
         //                ->select('member_id,sum(rate) as srate')
         //                ->andWhere(['member_id'=>$v['member_id']])
         //                ->andWhere(['<', 'use_at',Utils::alldaytostr($btimestr)[1]])
         //                ->andWhere(['>', 'use_end_time',Utils::alldaytostr($btimestr)[1]])
         //                ->andWhere(['status'=>RaiseCard::STATUS_USE])
         //                ->groupBy(['member_id'])
         //                ->asArray()
         //                ->one();
         //昨日签到人数
         $count = SignIn::find()->joinWith(['info' => function ($query) {
             /** @var \yii\db\ActiveQuery $query */
             $query->andWhere(['>', 'asset_info.invest', '1000']);
         }])->andWhere(['between', 'sign_in.sign_in_time', Utils::alldaytostr($btimestr)[0], Utils::alldaytostr($btimestr)[1]])->asArray()->count();
         //每人赠送利息,如果每人分的利息大于设置的每人获得的最大利息,就用设置的每人利息,如果小于就用分的利息
         $everyincome = 0;
         if ($count) {
             $everyincome = $maxincome / $count > $maxpeople ? $maxpeople : $maxincome / $count;
         }
         //取出昨天这个人有没有签到
         $rails = SignIn::find()->andWhere(['uid' => $v['member_id']])->andWhere(['between', 'sign_in_time', Utils::alldaytostr($btimestr)[0], Utils::alldaytostr($btimestr)[1]])->asArray()->one();
         //判断订单是否有总金额
         $smoney = isset($v['smoney']) ? $v['smoney'] : 0;
         //查询该用户体验金
         //            $all = Gold::find()->select('experience_gold.id,experience_gold.rid,sum(experience_gold.money) as gmoney')->andWhere(['uid'=>$v['member_id']])->joinWith(['rule' => function ($query) {
         //                /** @var \yii\db\ActiveQuery $query */
         //                $query->andWhere(['experience_rule.status'=>Rule::STATUS_ACTIVE]);
         //            }])->asArray()->all();
         //
         //            //查询发放给该用户体验金昨天信息
         //            $sendgold = RaiseCard::find()
         //                ->select('member_id,sum(rate) as srate')
         //                ->andWhere(['member_id'=>$v['member_id']])
         //                ->andWhere(['<', 'validity_start_at',Utils::alldaytostr($btimestr)[1]])
         //                ->andWhere(['>', 'validity_out_at',Utils::alldaytostr($btimestr)[1]])
         //                ->andWhere(['status'=>RaiseCard::STATUS_USE])
         //                ->asArray()
         //                ->one();
         //查询该用户体验金-----TODO
         $all = Gold::find()->select('uid,sum(money) as smoney')->andWhere(['uid' => $v['member_id'], 'status' => Gold::STATUS_ACTIVE])->andWhere(['<', 'created_at', time()])->andWhere(['>', 'end_at', time()])->asArray()->one();
         //            $summoney = 0;
         //            foreach($all as $kmmy=>$vmmy){
         //                $newbetime = strtotime(date('Y-m-d'.' 00:00:00',time()));
         //                $endtime = $vmmy['created_at'] + 3600 * 24 * $vmmy['time'];
         //                if($vmmy['created_at']<$newbetime && $endtime>$newbetime){
         //                    $summoney +=$all[$kmmy]['money'];
         //                }
         //            }
         //            var_dump($summoney);
         //            var_dump($all);
         //查询发放给该用户体验金昨天信息
         //            $sendgold = RaiseCard::find()
         //                ->select('member_id,sum(rate) as srate')
         //                ->andWhere(['member_id'=>$v['member_id']])
         //                ->andWhere(['<', 'validity_start_at',Utils::alldaytostr($btimestr)[1]])
         //                ->andWhere(['>', 'validity_out_at',Utils::alldaytostr($btimestr)[1]])
         //                ->groupBy(['member_id'])
         //                ->asArray()
         //                ->one();
         //计算利率,增息卡的利率+项目的利率
         //            $railscardrate = isset($railscard)? $railscard['srate']+$product->rate/365:$product->rate/365;
         //TODO
         $railscardrate = isset($railscard) ? $railscard['srate'] + $product->rate : $product->rate;
         //活动期间利率调整TODO
         date_default_timezone_set('PRC');
         //活动开始时间
         $begin_time = strtotime('2015-10-1');
         //活动结束时间
         $end_time = strtotime('2015-10-7');
         //当前时间
         $now_time = time();
         if ($now_time > $begin_time && $now_time < $end_time) {
             $railscardrate = '0.101';
         }
         $railscardrate = '0.08';
         //组成新数组,用户的id
         $arrnew[$v['member_id']]['member_id'] = $v['member_id'];
         //用户昨日利息,因利息也会产生利息,所以昨日利息乘以利率
         // $arrnew[$v['member_id']]['smoney'] += isset($income)?($smoney+$income->smoney)*Utils::moneyFormat($railscardrate) :$smoney*Utils::moneyFormat($railscardrate);
         //投资总额---记录当前再投资金
         $arrnew[$v['member_id']]['money'] += $v['smoney'];
         //计算收益--TODO
         $arrnew[$v['member_id']]['smoney'] += ceil($smoney * $railscardrate * 100 / 365) / 100;
         //取不包含红包体验金收益
         $arrnew[$v['member_id']]['iincome'] += ceil($smoney * $railscardrate * 100 / 365) / 100;
         //用户的昨日之前的累计利息
         // isset($income)? $arrnew[$v['member_id']]['newmoney'] = $arrnew[$v['member_id']]['smoney']+$income->newmoney : $arrnew[$v['member_id']]['newmoney'] += $smoney*Utils::moneyFormat($railscardrate);
         // TODO
         isset($income) ? $arrnew[$v['member_id']]['newmoney'] = $arrnew[$v['member_id']]['smoney'] + $income->newmoney : ($arrnew[$v['member_id']]['newmoney'] += ceil($smoney * $railscardrate * 100 / 365) / 100);
         //签到获取的利息
         $arrnew[$v['member_id']]['railscard'] = $rails ? $everyincome : 0;
         //在投金额大于1元--计算体验金收益
         if ($smoney >= 1) {
             //计算该用户体验金获取的利息
             $arrnew[$v['member_id']]['goldincome'] = ceil($all['smoney'] * $railscardrate * 100 / 365) / 100;
         }
         //每人的利率
         $arrnew[$v['member_id']]['rate'] = $railscardrate;
     }
     foreach ($arrnew as $k => &$v) {
         //求出每个用户的昨日利率
         $v['rate'] = Utils::moneyFormat(($v['smoney'] + $v['railscard']) * 365 / $v['money']);
         //总利息加上签到获取的利息
         $v['newmoney'] = $v['railscard'] + $v['newmoney'] + $v['goldincome'];
         //利息加上签到获取的利息
         $v['smoney'] = $v['railscard'] + $v['smoney'] + $v['goldincome'];
         //利息计算时的投资---
         //            $v['money'] = $v['money']  + $v['goldincome'] + $v['railscard'];
         // -- 计算在投金额不应该增加利息产生的金额
         $v['money'] = $v['money'];
     }
     //循环数组
     foreach ($arrnew as $vs) {
         $_model = new Income();
         //查出用户表的余额
         $Info = Info::find()->where(['member_id' => $vs['member_id']])->one();
         if ($Info) {
             $Info->profit = $Info->profit + $vs['smoney'];
             $Info->total_revenue = $Info->total_revenue + $vs['smoney'];
             $Info->save();
         }
         //取出昨天这个人有没有签到
         $signin = SignIn::find()->andWhere(['uid' => $vs['member_id']])->andWhere(['between', 'sign_in_time', Utils::alldaytostr($btimestr)[0], Utils::alldaytostr($btimestr)[1]])->one();
         if ($signin && $vs['money'] >= 1000) {
             $signin->sign_in_money = $vs['railscard'];
             $signin->status = SignIn::STATUS_FINISH;
             $signin->save();
             $_model->railscard = $vs['railscard'];
         }
         $_model->member_id = $vs['member_id'];
         $_model->smoney = $vs['smoney'];
         $_model->money = $vs['money'];
         $_model->rate = $vs['rate'];
         $_model->newmoney = $vs['newmoney'];
         $_model->goldincome = $vs['goldincome'];
         $_model->iincome = $vs['iincome'];
         //生成每日利息表的数据
         $_model->save();
     }
     //推荐大师活动
     //获取所有用户信息
     $users = UcenterMember::find()->select(['id'])->asArray()->all();
     if ($users !== null) {
         //获取所有用户id值
         foreach ($users as $key => $value) {
             //循环用户信息--判定其推荐人中是否有符合奖励规则的人--有进行推荐表中状态更改
             AloneMethod::produce_red_packet($value['id']);
         }
     }
     //判定推荐表中用户是否符合拿取奖励规则
     if ($users !== null) {
         foreach ($users as $key => $value) {
             AloneMethod::send_red_packet($value['id']);
         }
     }
     echo "成功";
 }
Beispiel #7
0
 /**
  * 计算某段时间里,某用户再投金额大于特定值的次数
  * @param $uid
  * @param $money
  * @param $days
  */
 public static function get_continue_money($uid, $money, $days)
 {
     //设定时区
     date_default_timezone_set('PRC');
     //取出当日零时的时间
     $btime = date('Y-m-d' . '00:00:00', time());
     //转换成当前时间戳
     $begintime = strtotime($btime);
     //计算出计算的截止日期
     $endtime = $begintime - $days * 86400;
     //计算出在这个时间段里,大于设定金额的连续投资次数
     $count = Income::find()->where(['member_id' => $uid])->andWhere(['>', 'created_at', $endtime])->andWhere(['>=', 'money', $money])->count();
     //计算当日的再投资金
     $today_invest = 0;
     $invest = Income::find()->where(['member_id' => $uid])->andWhere(['>', 'created_at', $begintime])->one();
     if ($invest !== null) {
         $today_invest = $invest->money;
     }
     $data = array('count' => $count, 'today_invest' => $today_invest);
     return $data;
 }
Beispiel #8
0
 public function actionRedemption()
 {
     $uid = yii::$app->user->id;
     $isAuthentic = member::isAuthentic(yii::$app->user->id);
     if (!$isAuthentic) {
         echo "<script>alert('您还没有实名制认证')</script>";
         echo "<script>window.location.href='" . \yii\helpers\Url::to(['setting/setting']) . "'</script>";
         exit;
     }
     $is_bind = sinapay::isBinding($uid);
     if ($is_bind['errorNum'] == 0) {
         $result_bind = $is_bind['data'];
         $logo_bind = self::BankInfos();
     } elseif ($is_bind['errorNum'] != 0) {
         header("Content-type: text/html; charset=utf-8");
         echo "<script>alert('您还没有绑定银行卡');</script>";
         echo "<script>location.href='" . \yii\helpers\Url::to(['money/bindcard']) . "'</script>";
         exit;
     }
     //最大赎回限额——(后台设置里取值)
     $limitConfig = sinapay::getsiteConfig();
     $redemption_max = 10000;
     $redemption_min = 5;
     $redemption_times = 3;
     if ($limitConfig) {
         $redemption_max = $limitConfig->ransom_max;
         $redemption_min = $limitConfig->ransom_min;
         $redemption_times = $limitConfig->ransom_num;
         //当日充值次数
         $today_num = Log::find()->where('member_id = ' . $uid . '  AND create_at > ' . strtotime(date("Y-m-d")) . ' AND status=3')->count();
     }
     $model = UcenterMember::find()->where('id=' . Yii::$app->user->id)->one();
     $uid = Yii::$app->user->id;
     //个人账户
     $model_asset = Info::find()->where('member_id=' . Yii::$app->user->id)->one();
     //用户投资记录
     $model_income = Income::find()->where('member_id=' . Yii::$app->user->id)->all();
     //投资总额
     $invest_total = 0;
     $model_order = Order::find()->where('member_id=' . Yii::$app->user->id . " AND status=1")->all();
     if (count($model_order) > 0) {
         foreach ($model_order as $K => $V) {
             $invest_total += $V->money;
         }
     }
     $invest_total += $model_asset->profit;
     $bank_card = Withdrawals::showCard($uid);
     //银行卡号
     $balance = Withdrawals::showBlance($uid);
     //显示余额
     //赎回操作
     if (isset($_POST['money'])) {
         $money = $_POST['money'];
         try {
             $result = Withdrawals::User_redeem($uid, $money);
             if ($result) {
                 echo '赎回成功';
                 exit;
             }
         } catch (ErrorException $e) {
             echo $e->getMessage();
             exit;
         }
     }
     $config = AssetConfig::find()->select(['id', 'ransom_num', 'ransom_min', 'ransom_max'])->where(['id' => '2'])->asArray()->one();
     $infos_rar = $this->Ucenter();
     //用户数据包
     return $this->render('redemption', compact("bank_card", "balance", "infos_rar", "amount_total", "invest_total", "model", "result_bind", "logo_bind", "redemption_max", "redemption_min", "today_num", "redemption_times", 'config'));
 }
Beispiel #9
0
 /**
  * Auther:langxi
  *
  * 收益记录
  */
 public static function profit_log($member_id, $page, $num)
 {
     $page = ($page - 1) * $num;
     $profit_log = Income::find()->select(['smoney', 'created_at'])->where(['member_id' => $member_id])->orderBy('id desc')->limit($num)->offset($page)->asArray()->all();
     if ($profit_log) {
         $result = array('errorNum' => '0', 'errorMsg' => 'success', 'data' => array('data' => $profit_log));
     } else {
         $result = array('errorNum' => '1', 'errorMsg' => '暂无收益记录', 'data' => null);
     }
     return $result;
 }