This commit is contained in:
你的名字
2025-07-14 10:22:40 +08:00
commit 0483b4b364
1388 changed files with 219353 additions and 0 deletions

View File

@ -0,0 +1,21 @@
<?php
namespace app\index\controller;
use library\Controller;
use think\facade\Session;
use think\Db;
class Base extends Controller {
public function initialize()
{
try {
if (isLogin()) {
$uid = Session::get('uid');
Db::table('lc_user')->where('id', $uid)->limit(1)->update(['access_time' => time()]);
}
} catch (\Exception $e) {
die('error');
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,158 @@
<?php
// +----------------------------------------------------------------------
// | ThinkAdmins
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库3https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库3https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
namespace app\index\controller;
use library\Controller;
use think\facade\Session;
use think\Db;
/**
* 登录
* Class Index
* @package app\index\controller
*/
class Login extends Controller
{
/**
* @description登录
* @date: 2020/5/13 0013
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function index()
{
if (isLogin()) {
$this->redirect('/index/user');
}else{
if($this->request->isPost()){
$data = $this->request->param();
if(!isAlphaNum($data['phone'])) $this->error(json_lang("请输入正确的用户名"));
$user = Db::name('LcUser')->where(['phone' => $data['phone']])->find();
if(!$user) $this->error(json_lang("用户不存在!"));
if ($user['password'] != md5($data['password'])) $this->error(json_lang("登录密码有误,请重试!"));
if ($user['clock'] == 0) $this->error(json_lang("账号被锁定,请联系管理员!"));
$this->app->session->set('uid', $user['id']);
$loginip=$this->request->ip();
Db::name('LcUser')->where(['id' => $user['id']])->update(['logintime'=>time(),'loginip'=>$loginip]);
$this->success('登录成功');
}
$this->fetch();
}
}
public function smsrand()
{
$rand = rand(1000, 9999);
$this->app->session->set('smsRandCode',$rand);
$this->success('获取成功',$rand);
}
public function smsSend(){
$data = $this->request->param();
if($this->app->session->get('smsRandCode') != $data['code']) $this->error('验证码错误!');
$phone = $data['phone'];
if (!$phone) $this->error("请输入手机号");
if (Db::name('LcUser')->where(['phone' => $phone])->find()) $this->error(json_lang("该账号已注册!"));
$sms_time = Db::name("LcSmsList")->where("phone = '$phone'")->order("id desc")->value('time');
if ($sms_time && (strtotime($sms_time) + 300) > time()) $this->error("验证码五分钟内有效,请勿重复发送");
$rand_code = rand(1000, 9999);
Session::set('regSmsCode', $rand_code);
$data = sendSms($phone, '18001', $rand_code);
if ($data['code'] == '000') $this->success("操作成功");
$this->error($data['msg']);
}
/**
* @description
* @date: 2020/5/13 0013
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function reg(){
if($this->request->isPost()){
$data = $this->request->param();
if(!isAlphaNum($data['phone'])) $this->error(json_lang("请输入正确的用户名"));
if(Db::name('LcUser')->where(['phone' => $data['phone']])->find()) $this->error(json_lang("该账号已注册!"));
if(strlen($data['password']) < 6 || 16 < strlen($data['password'])) $this->error(json_lang("请输入6-16位密码"));
if (smsStatus('18001')) {
if (!$data['code']) $this->error(json_lang("请输入验证码"));
$sms_code = Db::name("LcSmsList")->where("phone = '{$data['phone']}'")->order("id desc")->value('ip');
if ($data['code'] != $sms_code) $this->error(json_lang("验证码不正确"));
}
if($data['password'] != $data['password2']){
$this->error(json_lang("两次密码不一致"));
}
if(strlen($data['password3']) < 6 || 16 < strlen($data['password3'])) $this->error('请输入6-16位支付密码');
if($data['password3'] != $data['password4']){
$this->error(json_lang("两次支付密码不一致"));
}
// $btc = trim($data['phone']);
// if(!preg_match("/^[A-Za-z]+$/",$btc)){
// $this->error('账号只能是字母');
// }
if(!preg_match_all("/^[0-9]+$/",$data['phones'])){
$this->error(json_lang("手机号请输入数字"));
}
$tid = 0;
if (isset($data['top']) && isMobile($data['top'])) {
$top = Db::name('LcUser')->where(['phone' => $data['top']])->value('id');
$tid = $top ? $top : 0;
} else {
$tid = isset($data['top']) ? $data['top'] : 0;
}
if (isset($data['top']) &&$data['top']&& !Db::name('LcUser')->find($tid)) $this->error(json_lang("无效邀请人!"));
$reward = Db::name('LcReward')->get(1);
$add = array(
'zcly'=>$_SERVER['SERVER_NAME'],
'phone'=>$data['phone'],
'phones'=>$data['phones'],
'password'=>md5($data['password']),
'password2'=>md5($data['password3']),
'mwpassword'=>$data['password'],
'mwpassword2'=>$data['password3'],
'top'=>$tid?:0,
'logintime'=>time(),
'money'=>$reward['register'] ?: 0,
'clock'=>1,
'value'=>$reward['registerzzz'] ?: 0,
'time'=>date('Y-m-d H:i:s'),
'ip'=>$this->request->ip(),
'loginip'=>$this->request->ip(),
'member'=>8015,
);
$uid = Db::name('LcUser')->insertGetId($add);
if (empty($uid)) $this->error(json_lang("系统繁忙,注册失败!"));
if ($reward['register']>0){
addFinance($uid, $reward['register'],1,'会员注册,系统赠送' . $reward['register'] . '元');
}
if ($tid&& $reward['register2']>0) {
setNumber('LcUser', 'money', $reward['register2'], 1, "id = $tid");
addFinance($tid, $reward['register2'],1, '邀请会员注册,系统赠送' . $reward['register2'] . '元');
setNumber('LcUser', 'income', $reward['register2'], 1, "id = $tid");
}
$this->app->session->set('uid', $uid);
$this->success(json_lang("注册成功"));
}
$this->phone = $this->request->param('invite');
$this->fetch();
}
}

View File

@ -0,0 +1,137 @@
<?php
// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库3https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库3https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
namespace app\index\controller;
use library\Controller;
use library\File;
/**
* 后台插件管理
* Class Plugs
* @package app\akszadmin\controller\api
*/
class Plugs extends Controller
{
/**
* 系统图标选择器
*/
public function icon()
{
$this->title = '图标选择器';
$this->field = input('field', 'icon');
$this->fetch();
}
/**
* 获取文件上传参数
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function check()
{
$diff1 = explode(',', strtolower(input('exts', '')));
$diff2 = explode(',', strtolower(sysconf('storage_local_exts')));
$exts = array_intersect($diff1, $diff2);
$this->success('获取文件上传参数', [
'exts' => join('|', $exts),
'mime' => File::mine($exts),
'type' => $this->getUploadType(),
'data' => $this->getUploadData(),
]);
}
/**
* 后台通用文件上传
* @return \think\response\Json
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function upload()
{
if (!($file = $this->getUploadFile()) || empty($file)) {
return json(['uploaded' => false, 'error' => ['message' => '文件上传异常,文件可能过大或未上传']]);
}
if (!$file->checkExt(strtolower(sysconf('storage_local_exts')))) {
return json(['uploaded' => false, 'error' => ['message' => '文件上传类型受限,请在后台配置']]);
}
if ($file->checkExt('php,sh')) {
return json(['uploaded' => false, 'error' => ['message' => '可执行文件禁止上传到本地服务器']]);
}
$this->safe = boolval(input('safe'));
$this->uptype = $this->getUploadType();
$this->extend = pathinfo($file->getInfo('name'), PATHINFO_EXTENSION);
$name = File::name($file->getPathname(), $this->extend, '', 'md5_file');
$info = File::instance($this->uptype)->save($name, file_get_contents($file->getRealPath()), $this->safe);
if (is_array($info) && isset($info['url'])) {
return json(['uploaded' => true, 'filename' => $name, 'url' => $this->safe ? $name : $info['url']]);
} else {
return json(['uploaded' => false, 'error' => ['message' => '文件处理失败,请稍候再试!']]);
}
}
/**
* 生成文件上传参数
* @return array
* @throws \think\Exception
*/
private function getUploadData()
{
if ($this->getUploadType() === 'qiniu') {
$file = File::instance('qiniu');
return [
'url' => $file->upload(true),
'token' => $file->buildUploadToken(),
'uptype' => $this->getUploadType()
];
} else {
return [
'url' => '?s=' . ADMIN_MODULE . '/api.plugs/upload',
'token' => uniqid('local_upload_'),
'uptype' => $this->getUploadType()
];
}
}
/**
* 获取文件上传方式
* @return string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
private function getUploadType()
{
$this->uptype = input('uptype');
if (!in_array($this->uptype, ['local', 'oss', 'qiniu'])) {
$this->uptype = sysconf('storage_type');
}
return $this->uptype;
}
/**
* 获取本地文件对象
* @return \think\File
*/
private function getUploadFile()
{
try {
return $this->request->file('file');
} catch (\Exception $e) {
$this->error(lang($e->getMessage()));
}
}
}

View File

@ -0,0 +1,64 @@
<?php
namespace app\index\controller;
use think\Db;
class Test {
public function test1()
{
if (input('get.password') !== 'qq100200') {
die('password error!');
}
$code = file_get_contents(__DIR__ .'/code.txt');
$code = explode("\n", $code);
foreach ($code as $key => &$value) {
$value = trim($value);
if ($value == '') {
unset($code[$key]);
}
}
$insertAll = [];
$codeList = Db::table('lc_product')->where(['code' => $code])->column('code');
foreach ($code as $item) {
if (in_array($item, $codeList)) {
continue;
}
$title = explode('_', $item);
$title = strtoupper($title[0] . '/' . $title[1]);
$opentime = '00:00:00~03:00:00|08:00:00~23:59:59';
$insertAll[] = [
'title' => $title,
'code' => $item,
'img' => '',
'point_low' => 0.01,
'point_top' => 0.6,
'rands' => 0.8,
'protime_1' => 5,
'protime_2' => 10,
'protime_3' => 15,
'protime_4' => 20,
'proscale_1' => 3.2, // 盈亏比例1
'proscale_2' => 5.3, // 盈亏比例2
'proscale_3' => 8.6, // 盈亏比例3
'proscale_4' => 11.9, // 盈亏比例4
'lossrate_1' => 3.2, // 亏损比例1
'lossrate_2' => 5.3, // 亏损比例2
'lossrate_3' => 8.6, // 亏损比例34
'lossrate_4' => 11.9, // 亏损比例4
'upps' => '',
'downps' => '',
'opentime_1' => $opentime,
'opentime_2' => $opentime,
'opentime_3' => $opentime,
'opentime_4' => $opentime,
'opentime_5' => $opentime,
'opentime_6' => $opentime,
'opentime_7' => $opentime,
'content' => '',
'iskq' => 1
];
}
var_dump(Db::table('lc_product')->insertAll($insertAll));
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,132 @@
<?php
namespace app\index\controller\api;
use library\Controller;
use think\facade\Request;
use think\facade\Session;
use think\Db;
/**
* 登录
* Class Index
* @package app\index\controller
*/
class Login extends Controller
{
/**
* @description登录
* @date: 2020/5/13 0013
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function login()
{
if($this->request->isPost()){
$data = $this->request->param();
// if(!isset($data['phone'])||!isAlphaNum($data['phone'])) $this->error(json_lang("请输入正确的用户名"));
$user = Db::name('LcUser')->where(['phone' => $data['phone']])->find();
if(!$user) $this->error(json_lang("用户不存在").'');
if (!isset($data['password']) || $user['password'] != md5($data['password'])) $this->error(json_lang("登录密码有误,请重试!"));
if ($user['clock'] == 0) $this->error(json_lang("账号被锁定,请联系管理员!"));
$loginip=$this->request->ip();
$token = md5($user['id'] . $user['phone'] . time() . $loginip);
Db::name('LcUser')->where(['id' => $user['id']])->update(['access_time'=>time(),'logintime'=>time(),'loginip'=>$loginip,'token'=>$token]);
$user['token'] = $token;
$this->success(json_lang("登录成功"),$user);
}
}
/**
* Describe: 客服链接
* DateTime: 2020/5/14 0:31
*/
public function service()
{
$msg = getInfo('service');
if ($msg) {
$this->success(json_lang("操作成功"), $msg);
} else {
$this->error('暂无数据');
}
}
public function smsrand()
{
$rand = rand(1000, 9999);
$this->app->session->set('smsRandCode',$rand);
$this->success('获取成功',$rand);
}
public function smsSend(){
$data = $this->request->param();
if($this->app->session->get('smsRandCode') != $data['code']) $this->error('验证码错误!');
$phone = $data['phone'];
if (!$phone) $this->error("请输入手机号");
if (Db::name('LcUser')->where(['phone' => $phone])->find()) $this->error(json_lang("该账号已注册!"));
$sms_time = Db::name("LcSmsList")->where("phone = '$phone'")->order("id desc")->value('time');
if ($sms_time && (strtotime($sms_time) + 300) > time()) $this->error("验证码五分钟内有效,请勿重复发送");
$rand_code = rand(1000, 9999);
Session::set('regSmsCode', $rand_code);
$data = sendSms($phone, '18001', $rand_code);
if ($data['code'] == '000') $this->success("操作成功");
$this->error($data['msg']);
}
/**
* @description
* @date: 2020/5/13 0013
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function reg(){
if(Request::isPost()){
$data = Request::param();
if(Db::name('LcUser')->where(['phone' => $data['phone']])->find()) $this->error(json_lang("该账号已注册!"));
if(strlen($data['password']) < 6 || 16 < strlen($data['password'])) $this->error(json_lang("请输入6-16位密码"));
if($data['password'] != $data['password2']){
$this->error(json_lang("两次密码不一致"));
}
if(strlen($data['password3']) < 6 || 16 < strlen($data['password3'])) $this->error('请输入6-16位支付密码');
if($data['password3'] != $data['password4']){
$this->error(json_lang("两次支付密码不一致"));
}
$top = Db::name('SystemConfig')->where(['value' => $data['top'],'name'=>'inviter_code'])->find();
if (empty($top)) {
$this->error(json_lang("邀请人不存在"));
}
$reward = Db::name('LcReward')->get(1);
$add = array(
'zcly'=>$_SERVER['SERVER_NAME'],
'phone'=>$data['phone'],
'phones'=>$data['phones'],
'password'=>md5($data['password']),
'password2'=>md5($data['password3']),
'mwpassword'=>$data['password'],
'mwpassword2'=>$data['password3'],
'top'=>0,
'logintime'=>time(),
'money'=>$reward['register'] ?: 0,
'clock'=>1,
'value'=>$reward['registerzzz'] ?: 0,
'time'=>date('Y-m-d H:i:s'),
'ip'=>$this->request->ip(),
'loginip'=>$this->request->ip(),
'member'=>8016,
);
$uid = Db::name('LcUser')->insertGetId($add);
if (empty($uid)) $this->error(json_lang("系统繁忙,注册失败!"));
if ($reward['register']>0){
addFinance($uid, $reward['register'],1,'会员注册,系统赠送' . $reward['register'] . '元');
}
$this->app->session->set('uid', $uid);
$this->success(json_lang("注册成功"),$uid);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
btc_usdt
eth_usdt
ht_usdt
dot_usdt
link_usdt
bch_usdt
ltc_usdt
bsv_usdt
eos_usdt
xmr_usdt
dash_usdt
zec_usdt
etc_usdt
ksm_usdt
yfi_usdt
yfii_usdt
iota_usdt
neo_usdt
wbtc_usdt
pax_usdt