Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
2025-12-23 16:20:03 +08:00
9 changed files with 42 additions and 32 deletions

View File

@@ -50,7 +50,6 @@ class Cron
//每天执行 //每天执行
/* /*
* 清除房间热度值 * 清除房间热度值
* 清除房间离线超24小时的用户
* 系统降身价 * 系统降身价
* 过期验证码删除 * 过期验证码删除
*/ */
@@ -87,9 +86,10 @@ class Cron
//房间小时榜发礼物(每小时执行一次 //每小时执行一次
/* /*
* 小时榜 开始发礼物 * 小时榜 开始发礼物
* 清除房间离线超1小时的用户
*/ */
public function RoomHourRanking(){ public function RoomHourRanking(){
$cron = new \app\cron\controller\RoomHourRanking(); $cron = new \app\cron\controller\RoomHourRanking();

View File

@@ -84,7 +84,7 @@ class Payment extends Controller
//引用支付宝sdk //引用支付宝sdk
Loader::import('AliPayV2.AliPay', EXTEND_PATH, '.php'); Loader::import('AliPayV2.AliPay', EXTEND_PATH, '.php');
$ali = new \AliPay(); $ali = new \AliPay();
$result['ali'] = $ali->aliAppPays($order_number, $money, $title); $result['ali'] = $ali->aliAppPays($order_number, $money, $title, $user_id);
}elseif($type == 1){ }elseif($type == 1){
//引用微信sdk //引用微信sdk
Loader::import('WxPay.WxPay', EXTEND_PATH, '.php'); Loader::import('WxPay.WxPay', EXTEND_PATH, '.php');

View File

@@ -43,11 +43,12 @@ class Sms extends Api
//频率控制 //频率控制
$last = db::name('sms')->where(['mobile' => $mobile, 'event' => $event])->order('id', 'DESC')->find(); $last = db::name('sms')->where(['mobile' => $mobile, 'event' => $event])->order('id', 'DESC')->find();
if ($last && time() - $last['createtime'] < 60) { if ($last && time() - $last['createtime'] < 60) {
return V(0, '发送频繁'); return V(0, '发送频繁');
} }
$ipSendTotal = db::name('sms')->where(['ip' => $this->request->ip()])->whereTime('createtime', '-1 hours')->count(); $ip = request()->server('HTTP_X_REAL_IP') ?: request()->server('HTTP_X_FORWARDED_FOR') ?: request()->ip();
$ipSendTotal = db::name('sms')->where(['ip' => $ip])->whereTime('createtime', '-1 hours')->count();
if ($ipSendTotal >= 7) { if ($ipSendTotal >= 7) {
return V(0, '发送频繁'); return V(0, '发送频繁');
} }
//发送短信 //发送短信
$ret = $this->send_smsbao_msg($mobile, $event); $ret = $this->send_smsbao_msg($mobile, $event);

View File

@@ -52,8 +52,12 @@ class Theme extends controller
$api_version = 0; $api_version = 0;
if ($system == 'iOS') { if ($system == 'iOS') {
$api_versions = db::name('version')->where(['type' => 2, 'status' => 1])->order('id', 'desc')->find(); $api_versions = db::name('version')->where(['type' => 2, 'status' => 1])->order('id', 'desc')->find();
$result = version_compare($api_versions['apiversion'],$app_version); //app的版本和用户使用的当前版本比对
if ($result < 0) { //$api_versions['newversion'] 是数据库当前的版本 也是用户使用的版本
//$app_version 有可能是appstore里面的审核版本 审核版本比用户的版本高
//审核版本给前端返回1
$result = version_compare($api_versions['newversion'],$app_version);
if ($result < 0) {//-1:前面版本小于后面版本,0:相等,1:前面版本大于后面版本
$api_version = 1; $api_version = 1;
} }
} }

View File

@@ -28,6 +28,7 @@ class Lottery extends Model
//获取礼物信息 //获取礼物信息
$gift_info = Db::name('vs_gift')->where(['gid'=>$gift_id]) $gift_info = Db::name('vs_gift')->where(['gid'=>$gift_id])
->field('gid as gift_id,gift_name,gift_price,file_type,base_image,play_image,gift_type,label,is_public_server')->find(); ->field('gid as gift_id,gift_name,gift_price,file_type,base_image,play_image,gift_type,label,is_public_server')->find();
$gift_info['play_image'] = '';//不要特效
//送给所有人的总价格 //送给所有人的总价格
$all_gift_price = $gift_info['gift_price'] * $num * count($toarray); $all_gift_price = $gift_info['gift_price'] * $num * count($toarray);

View File

@@ -19,10 +19,6 @@ class DaySeconds
$this->clear_room_today_hot_value();//0点以后房间热度值清零 $this->clear_room_today_hot_value();//0点以后房间热度值清零
echo "\n"; echo "\n";
echo "清除房间离线超24小时的用户\n";
$this->clear_room_offline_user();//0点以后清除房间离线超24小时用户
echo "\n";
echo "系统降身价:\n"; echo "系统降身价:\n";
$this->system_downgrade(); $this->system_downgrade();
echo "\n"; echo "\n";
@@ -37,22 +33,7 @@ class DaySeconds
} }
/*
* 0点以后清除房间离线超24小时用户
* 配置:定时脚本每天 0点 执行
* 配置:
*/
public function clear_room_offline_user() {
$room = db::name('vs_room_visitor')->where(['is_online' => 2])->select();
if($room){
foreach ($room as $value) {
$time = time() - $value['updatetime'];
if($time > 86400){
model('api/Room')->quit_room($value['user_id'], $value['room_id'],$value['user_id']);
}
}
}
}
/* /*
* 0点以后房间热度值清零 * 0点以后房间热度值清零

View File

@@ -14,9 +14,30 @@ class RoomHourRanking
function index() function index()
{ {
echo "小时榜 开始发礼物:\n"; echo "小时榜 开始发礼物:\n";
$this->send_gift();//小时榜 送礼物 // $this->send_gift();//小时榜 送礼物
echo "发礼物结束 \n"; echo "发礼物结束 \n";
echo "清除房间离线超1小时的用户\n";
$this->clear_room_offline_user();
echo "\n";
}
/*
* 每小时清除房间离线超1小时用户
*
*/
public function clear_room_offline_user() {
$room = db::name('vs_room_visitor')->where(['is_online' => 2])->select();
if($room){
foreach ($room as $value) {
$time = time() - $value['updatetime'];
if($time > 3600){
model('api/Room')->quit_room($value['user_id'], $value['room_id'],$value['user_id']);
}
}
}
} }
public function send_gift() public function send_gift()

View File

@@ -31,7 +31,8 @@ class AliPay
$this->appId = $configs['alipay_app_id']; $this->appId = $configs['alipay_app_id'];
$this->rsaPrivateKey = $configs['alipay_private_key']; $this->rsaPrivateKey = $configs['alipay_private_key'];
$this->alipayPublicKey = $configs['alipay_public_key']; $this->alipayPublicKey = $configs['alipay_public_key'];
$this->notifyUrl = $configs['web_site']."/api/Payment/notify_ali"; // $this->notifyUrl = $configs['web_site']."/api/Payment/notify_ali";
$this->notifyUrl = "http://vespa.qxyushen.top/api/Payment/notify_ali";
$aliPayPath = EXTEND_PATH.'/AliPayV2/alipay-sdk/aopV2/'; $aliPayPath = EXTEND_PATH.'/AliPayV2/alipay-sdk/aopV2/';
require_once $aliPayPath . 'AopCertClient.php'; require_once $aliPayPath . 'AopCertClient.php';
@@ -50,7 +51,7 @@ class AliPay
* @param string $subject 标题 * @param string $subject 标题
* @return string * @return string
*/ */
public function aliAppPays($orderid, $money, $subject) public function aliAppPays($orderid, $money, $subject, $user_id = 0)
{ {
$aop = new AopCertClient (); $aop = new AopCertClient ();
$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; $aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do';

View File

@@ -41,7 +41,8 @@ class WxPay
$data ["out_trade_no"] = $d['order_sn']; $data ["out_trade_no"] = $d['order_sn'];
$data ["total_fee"] = $total_fee; $data ["total_fee"] = $total_fee;
$data ["spbill_create_ip"] = $ip; $data ["spbill_create_ip"] = $ip;
$data ["notify_url"] = get_system_config_value("web_site")."/api/Payment/notify_wx"; // $data ["notify_url"] = get_system_config_value("web_site")."/api/Payment/notify_wx";
$data ["notify_url"] = "http://vespa.qxyushen.top/api/Payment/notify_wx";
$data ["trade_type"] = "APP"; $data ["trade_type"] = "APP";
$s = $this->getSign($data); $s = $this->getSign($data);