房间补贴修改。
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace app\cron\controller;
|
||||
|
||||
use app\common\controller\adminApi;
|
||||
use app\common\library\GiftTableManager;
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
|
||||
@@ -63,11 +64,31 @@ class Subsidy
|
||||
// if($v['quit_time'] && ($week_end_time_seach > $v['quit_time'])){
|
||||
// $week_end_time_seach = $v['quit_time'];
|
||||
// }
|
||||
// $transaction_one = db::name('vs_give_gift')
|
||||
// ->whereIn('from_id',$v['room_id'])
|
||||
// ->where(['from'=>['in',[2,3,6]],'createtime' => ['between', [$week_start_time_seach, $week_end_time_seach]]])
|
||||
// ->sum('total_price');
|
||||
// $tables = GiftTableManager::getTablesByTimeRange(
|
||||
// $week_start_time_seach,
|
||||
// $week_end_time_seach
|
||||
// );
|
||||
// $all_total_price =0;
|
||||
// if($tables){
|
||||
// foreach ($tables as $table_name){
|
||||
// //表前缀
|
||||
// $table_prefix = config('database.prefix');
|
||||
// $table_name = str_replace($table_prefix, '', $table_name);
|
||||
// $total_price = db::name($table_name)
|
||||
// ->whereIn('from_id',$v['room_id'])
|
||||
// ->where(['from'=>['in',[2,3,6]],'createtime' => ['between', [$week_start_time_seach, $week_end_time_seach]]])
|
||||
// ->sum('total_price');
|
||||
// $all_total_price += $total_price;
|
||||
// }
|
||||
// }
|
||||
// $transaction_one = $all_total_price;
|
||||
// $transaction += $transaction_one;
|
||||
//
|
||||
//// $transaction_one = db::name('vs_give_gift')
|
||||
//// ->whereIn('from_id',$v['room_id'])
|
||||
//// ->where(['from'=>['in',[2,3,6]],'createtime' => ['between', [$week_start_time_seach, $week_end_time_seach]]])
|
||||
//// ->sum('total_price');
|
||||
//// $transaction += $transaction_one;
|
||||
// }
|
||||
//
|
||||
// if($transaction > 0){
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace app\cron\controller;
|
||||
|
||||
use app\common\controller\Push;
|
||||
use app\common\library\GiftTableManager;
|
||||
use think\Cache;
|
||||
use think\Db;
|
||||
use Yzh\YunPay;
|
||||
@@ -739,10 +740,24 @@ class Test
|
||||
if($v['quit_time'] && ($week_end_time_seach > $v['quit_time'])){
|
||||
$week_end_time_seach = $v['quit_time'];
|
||||
}
|
||||
$transaction_one = db::name('vs_give_gift')
|
||||
->whereIn('from_id',$v['room_id'])
|
||||
->where(['from'=>['in',[2,3,6]],'createtime' => ['between', [$week_start_time_seach, $week_end_time_seach]]])
|
||||
->sum('total_price');
|
||||
$tables = GiftTableManager::getTablesByTimeRange(
|
||||
$week_start_time_seach,
|
||||
$week_end_time_seach
|
||||
);
|
||||
$all_total_price =0;
|
||||
if($tables){
|
||||
foreach ($tables as $table_name){
|
||||
//表前缀
|
||||
$table_prefix = config('database.prefix');
|
||||
$table_name = str_replace($table_prefix, '', $table_name);
|
||||
$total_price = db::name($table_name)
|
||||
->whereIn('from_id',$v['room_id'])
|
||||
->where(['from'=>['in',[2,3,6]],'createtime' => ['between', [$week_start_time_seach, $week_end_time_seach]]])
|
||||
->sum('total_price');
|
||||
$all_total_price += $total_price;
|
||||
}
|
||||
}
|
||||
$transaction_one = $all_total_price;
|
||||
$transaction += $transaction_one;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user