Compare commits
No commits in common. "248abb51c2112a5c3c6f79a83fa1a43259db54b4" and "caa7619b31f3c17ce8bf0564a7699052861a1338" have entirely different histories.
248abb51c2
...
caa7619b31
@ -3,15 +3,17 @@
|
|||||||
namespace app\controller\admin\api\v1;
|
namespace app\controller\admin\api\v1;
|
||||||
|
|
||||||
use app\dao\UserDao;
|
use app\dao\UserDao;
|
||||||
|
use app\dao\UserRewardDao;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
use App\Utils\ApiResponse;
|
use App\Utils\ApiResponse;
|
||||||
|
use App\model\Admin;
|
||||||
|
use app\model\Recommend;
|
||||||
use app\model\User;
|
use app\model\User;
|
||||||
use app\model\UserPhone;
|
use app\model\UserPhone;
|
||||||
|
use app\model\UserPhoneLog;
|
||||||
use hg\apidoc\annotation as Apidoc;
|
use hg\apidoc\annotation as Apidoc;
|
||||||
|
use app\model\Withdraw;
|
||||||
|
use App\Utils\Random;
|
||||||
use support\Db;
|
use support\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,11 +81,10 @@ class WithdrawController
|
|||||||
//是否同意转账
|
//是否同意转账
|
||||||
$type = $request->post('type');
|
$type = $request->post('type');
|
||||||
|
|
||||||
$Withdraw = Withdraw::where('id', $id)->first();
|
$rate = ExchangeRate::where('type', 'BDT')->get();
|
||||||
|
|
||||||
//计算积分
|
//计算积分
|
||||||
$money = $Withdraw->accumulated + $Withdraw->fee;
|
$money = $amount * 100 / $rate[0]['points'] + 300;
|
||||||
|
$Withdraw = Withdraw::where('id', $id)->first();
|
||||||
if($Withdraw->status != 1){
|
if($Withdraw->status != 1){
|
||||||
return ApiResponse::error(400,[],'请勿重复点击');
|
return ApiResponse::error(400,[],'请勿重复点击');
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ class UserController
|
|||||||
*/
|
*/
|
||||||
public function team_info(Request $request)
|
public function team_info(Request $request)
|
||||||
{
|
{
|
||||||
// UserPhoneLogDao::getOnlineTimeByPhone6HoserUserId();
|
UserPhoneLogDao::getOnlineTimeByPhone6HoserUserId();
|
||||||
$user_id = $request->data['id'];
|
$user_id = $request->data['id'];
|
||||||
$user = User::find($user_id);
|
$user = User::find($user_id);
|
||||||
$res = [
|
$res = [
|
||||||
|
@ -130,8 +130,8 @@ class WithdrawController
|
|||||||
return ApiResponseApp::error(null, '提现频繁请三分钟后再试');
|
return ApiResponseApp::error(null, '提现频繁请三分钟后再试');
|
||||||
}
|
}
|
||||||
//提现金额
|
//提现金额
|
||||||
$rate = ExchangeRate::where('type', 'BDT')->first();
|
$rate = ExchangeRate::where('type', 'BDT')->get();
|
||||||
$money = (int)$money_no / 100 * $rate->points;
|
$money = (int)$money_no / 100 * $rate[0]['points'];
|
||||||
|
|
||||||
$withdraw = Withdraw::create([
|
$withdraw = Withdraw::create([
|
||||||
'user_id' => $user_id,
|
'user_id' => $user_id,
|
||||||
@ -140,8 +140,6 @@ class WithdrawController
|
|||||||
'createtime2' => date('Y-m-d H:i:s'),
|
'createtime2' => date('Y-m-d H:i:s'),
|
||||||
'username' => $user->username,
|
'username' => $user->username,
|
||||||
'status_text' => '申请中',
|
'status_text' => '申请中',
|
||||||
'accumulated'=>$money_no,
|
|
||||||
'fee'=>0
|
|
||||||
]);
|
]);
|
||||||
//大于1000积分等待管理员审核
|
//大于1000积分等待管理员审核
|
||||||
if ($money_no >= 100000) {
|
if ($money_no >= 100000) {
|
||||||
@ -226,7 +224,8 @@ class WithdrawController
|
|||||||
if ($withdraw->status == 5) {
|
if ($withdraw->status == 5) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$money = $withdraw->accumulated + $withdraw->fee;
|
$rate = ExchangeRate::where('type', 'BDT')->get();
|
||||||
|
$money = $amount * 100 / $rate[0]['points'] + 300;
|
||||||
UserRewardDao::base($withdraw->user_id, 1, $money, '提现失败返还');
|
UserRewardDao::base($withdraw->user_id, 1, $money, '提现失败返还');
|
||||||
$withdraw->update([
|
$withdraw->update([
|
||||||
'status' => 5,
|
'status' => 5,
|
||||||
|
@ -3,16 +3,17 @@
|
|||||||
namespace app\controller\generalization\api\v1;
|
namespace app\controller\generalization\api\v1;
|
||||||
|
|
||||||
use app\dao\UserDao;
|
use app\dao\UserDao;
|
||||||
|
use app\dao\UserRewardDao;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
use App\Utils\ApiResponse;
|
use App\Utils\ApiResponse;
|
||||||
use App\model\Admin;
|
use App\model\Admin;
|
||||||
|
use app\model\Recommend;
|
||||||
use app\model\User;
|
use app\model\User;
|
||||||
use app\model\UserPhone;
|
use app\model\UserPhone;
|
||||||
|
use app\model\UserPhoneLog;
|
||||||
use hg\apidoc\annotation as Apidoc;
|
use hg\apidoc\annotation as Apidoc;
|
||||||
|
use app\model\Withdraw;
|
||||||
|
use App\Utils\Random;
|
||||||
use support\Db;
|
use support\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,8 +10,6 @@ use support\Model;
|
|||||||
* @property integer $status 1申请中 2 已到账 3已驳回 4等待银行打款 5支付失败
|
* @property integer $status 1申请中 2 已到账 3已驳回 4等待银行打款 5支付失败
|
||||||
* @property integer $gift_amount 赠送积分
|
* @property integer $gift_amount 赠送积分
|
||||||
* @property integer $createtime 创建时间(时间戳)
|
* @property integer $createtime 创建时间(时间戳)
|
||||||
* @property integer $accumulated 提现积分
|
|
||||||
* @property integer $fee 提现手续费
|
|
||||||
*/
|
*/
|
||||||
class Withdraw extends Model
|
class Withdraw extends Model
|
||||||
{
|
{
|
||||||
@ -40,7 +38,5 @@ class Withdraw extends Model
|
|||||||
'username',
|
'username',
|
||||||
'status_text',
|
'status_text',
|
||||||
'order_number',
|
'order_number',
|
||||||
'accumulated',
|
|
||||||
'fee'
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ class Task2
|
|||||||
{
|
{
|
||||||
// 每小时执行一次
|
// 每小时执行一次
|
||||||
new Crontab('0 */1 * * * *', function () {
|
new Crontab('0 */1 * * * *', function () {
|
||||||
return;
|
|
||||||
$start_time = time();
|
$start_time = time();
|
||||||
Rocketgo::test_login();
|
Rocketgo::test_login();
|
||||||
//查询系统配置 是否自动删除用户
|
//查询系统配置 是否自动删除用户
|
||||||
@ -59,8 +58,7 @@ class Task2
|
|||||||
|
|
||||||
|
|
||||||
//在线
|
//在线
|
||||||
if ($v['logged'] == 1) {
|
if ($phone->time > 3600 && $v['logged'] == 1) {
|
||||||
if ($phone->time > 3600) {
|
|
||||||
// 计算超过 1 小时的积分
|
// 计算超过 1 小时的积分
|
||||||
$hours = intdiv($phone->time, 3600);
|
$hours = intdiv($phone->time, 3600);
|
||||||
$score = $hours * 20;
|
$score = $hours * 20;
|
||||||
@ -73,18 +71,11 @@ class Task2
|
|||||||
|
|
||||||
// 保存用户收益到 UserReward 表
|
// 保存用户收益到 UserReward 表
|
||||||
UserRewardDao::Onhookincome($phone->user_id, $score, $phone->phone);
|
UserRewardDao::Onhookincome($phone->user_id, $score, $phone->phone);
|
||||||
// // 保存在线时长记录
|
// 保存在线时长记录
|
||||||
// UserPhoneLogDao::setOnlineTimeByPhone($phone->phone, 1, $currentTimestamp);
|
UserPhoneLogDao::setOnlineTimeByPhone($phone->phone, 1, $currentTimestamp);
|
||||||
// $phone->status = 1;
|
|
||||||
// $phone->time += $currentTimestamp - $phone->last_time;
|
|
||||||
// $phone->last_time = $currentTimestamp;
|
|
||||||
// $updateData[] = $phone;
|
|
||||||
}
|
|
||||||
$phone->status = 1;
|
$phone->status = 1;
|
||||||
$phone->time += $currentTimestamp - $phone->last_time;
|
$phone->time += $currentTimestamp - $phone->last_time;
|
||||||
$phone->last_time = $currentTimestamp;
|
$phone->last_time = $currentTimestamp;
|
||||||
// 保存在线时长记录
|
|
||||||
UserPhoneLogDao::setOnlineTimeByPhone($phone->phone, 0, $currentTimestamp);
|
|
||||||
$updateData[] = $phone;
|
$updateData[] = $phone;
|
||||||
}
|
}
|
||||||
//不在线
|
//不在线
|
||||||
|
Loading…
x
Reference in New Issue
Block a user