签约房-装扮-降身卡功能开发-个人装扮-降身卡使用
This commit is contained in:
@@ -384,7 +384,7 @@ class Decorate extends Model
|
|||||||
Db::commit();
|
Db::commit();
|
||||||
if($info['type'] == 12){
|
if($info['type'] == 12){
|
||||||
//使用降身卡,降低用户身价
|
//使用降身卡,降低用户身价
|
||||||
$reduce_ratio = db::name('vs_decorate')->where(['did' => $info['did']])->value('reduce_ratio') ?? 0;
|
$reduce_ratio = db::name('vs_decorate')->where(['did' => $info['did']])->value('ext_value') ?? 0;
|
||||||
$market_value = db::name('user')->where(['id' => $uid])->value('market_value');
|
$market_value = db::name('user')->where(['id' => $uid])->value('market_value');
|
||||||
if($reduce_ratio){
|
if($reduce_ratio){
|
||||||
$reduce_market_value = $market_value * $reduce_ratio / 100;
|
$reduce_market_value = $market_value * $reduce_ratio / 100;
|
||||||
@@ -399,9 +399,9 @@ class Decorate extends Model
|
|||||||
db::name('user')->where(['id' => $uid])->update(['market_value' => $up_market_value]);
|
db::name('user')->where(['id' => $uid])->update(['market_value' => $up_market_value]);
|
||||||
//记录一条日志
|
//记录一条日志
|
||||||
db::name('vs_user_market_value_log')->insert([
|
db::name('vs_user_market_value_log')->insert([
|
||||||
'user id' => $uid,
|
'user_id' => $uid,
|
||||||
'before' => $market_value,
|
'before' => $market_value,
|
||||||
'change value'=> $reduce_market_value,
|
'change_value'=> $reduce_market_value,
|
||||||
'afterwards'=> $up_market_value,
|
'afterwards'=> $up_market_value,
|
||||||
'type' => 2,
|
'type' => 2,
|
||||||
'createtime'=> time()
|
'createtime'=> time()
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ class RoomPan
|
|||||||
//发放
|
//发放
|
||||||
//抽中礼物落包
|
//抽中礼物落包
|
||||||
$res = [];
|
$res = [];
|
||||||
$res = model('api/UserGiftPack')->change_user_gift_pack($value['user_id'],$value['gift_id'],$value['num'],model('UserGiftPack')::XLH_DRAW_GIFT_GET,"巡乐会中奖发放");
|
$res = model('api/UserGiftPack')->change_user_gift_pack($value['user_id'],$value['gift_id'],$value['num'],model('api/UserGiftPack')::XLH_DRAW_GIFT_GET,"巡乐会中奖发放");
|
||||||
if ($res['code'] != 1) {
|
if ($res['code'] != 1) {
|
||||||
echo $res['msg']."\n";
|
echo $res['msg']."\n";
|
||||||
continue;
|
continue;
|
||||||
@@ -199,7 +199,7 @@ class RoomPan
|
|||||||
$res = [];
|
$res = [];
|
||||||
//获取房主id
|
//获取房主id
|
||||||
$user_id = db::name('vs_room')->where(['id'=>$value['room_id']])->value('user_id');
|
$user_id = db::name('vs_room')->where(['id'=>$value['room_id']])->value('user_id');
|
||||||
$res = model('api/UserGiftPack')->change_user_gift_pack($user_id,$value['homeowner_gift_id'],1,model('UserGiftPack')::XLH_DRAW_GIFT_GET,"巡乐会中奖后房主礼物发放");
|
$res = model('api/UserGiftPack')->change_user_gift_pack($user_id,$value['homeowner_gift_id'],1,model('api/UserGiftPack')::XLH_DRAW_GIFT_GET,"巡乐会中奖后房主礼物发放");
|
||||||
if ($res['code'] != 1) {
|
if ($res['code'] != 1) {
|
||||||
echo $res['msg']."\n";
|
echo $res['msg']."\n";
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace app\cron\controller;
|
namespace app\cron\controller;
|
||||||
|
|
||||||
|
use app\common\controller\Push;
|
||||||
|
use think\Cache;
|
||||||
use think\Db;
|
use think\Db;
|
||||||
use Yzh\YunPay;
|
use Yzh\YunPay;
|
||||||
|
|
||||||
@@ -10,7 +12,7 @@ use Yzh\YunPay;
|
|||||||
*/
|
*/
|
||||||
class Test
|
class Test
|
||||||
{
|
{
|
||||||
/*
|
/* https://vespa.qxyushen.top/api/Cron/Test
|
||||||
* 运行函数
|
* 运行函数
|
||||||
*/
|
*/
|
||||||
function index()
|
function index()
|
||||||
@@ -18,7 +20,8 @@ class Test
|
|||||||
// 设置脚本执行时间无限
|
// 设置脚本执行时间无限
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
echo "统计盲盒转盘错误数据\n";
|
echo "统计盲盒转盘错误数据\n";
|
||||||
$this->blind_box_error();
|
// $this->blind_box_error();
|
||||||
|
$this->xlh_gift_send();
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -155,4 +158,34 @@ class Test
|
|||||||
var_dump($arr);
|
var_dump($arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 巡乐会中奖后房主礼物补发放
|
||||||
|
*/
|
||||||
|
public function xlh_gift_send(){
|
||||||
|
die("暂停");
|
||||||
|
echo "开始补发巡乐会中奖后房主礼物 \n";
|
||||||
|
$xlh_list = db::name('vs_room_pan_xlh')->where(['id'=>['in',[279]]])->select();
|
||||||
|
echo "共有".count($xlh_list)."个需要发放的礼物 \n";
|
||||||
|
if(empty($xlh_list)){
|
||||||
|
echo "没有需要发放的礼物 \n";
|
||||||
|
}
|
||||||
|
foreach ($xlh_list as $key=>$value){
|
||||||
|
try{
|
||||||
|
//发放
|
||||||
|
//房主礼物落包
|
||||||
|
$res = [];
|
||||||
|
//获取房主id
|
||||||
|
$user_id = db::name('vs_room')->where(['id'=>$value['room_id']])->value('user_id');
|
||||||
|
$res = model('api/UserGiftPack')->change_user_gift_pack($user_id,$value['homeowner_gift_id'],1,model('api/UserGiftPack')::XLH_DRAW_GIFT_GET,"巡乐会中奖后房主礼物发放-补发");
|
||||||
|
if ($res['code'] != 1) {
|
||||||
|
echo $res['msg']."\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
echo "巡乐会中奖后房主礼物发放成功 房主Id:".$user_id."\n";
|
||||||
|
}catch (\Exception $e){
|
||||||
|
echo $e->getMessage()."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user