|
|
@@ -1,804 +0,0 @@
|
|
|
-<?php
|
|
|
-declare (strict_types = 1);
|
|
|
-
|
|
|
-namespace app\api\command;
|
|
|
-
|
|
|
-use AlibabaCloud\SDK\Dysmsapi\V20170525\Models\AddShortUrlResponseBody\data;
|
|
|
-use AlibabaCloud\SDK\OSS\OSS\SelectObjectRequest\body\selectRequest;
|
|
|
-use app\api\services\ThirdPayServices;
|
|
|
-use app\api\services\UserServices;
|
|
|
-use app\common\model\BoxMidHandleModel;
|
|
|
-use app\common\model\BoxModel;
|
|
|
-use app\common\model\CouponAreaModel;
|
|
|
-use app\common\model\CouponPlanLogModel;
|
|
|
-use app\common\model\CouponPlanModel;
|
|
|
-use app\common\model\ShopGoodsModel;
|
|
|
-use app\common\model\UserModel;
|
|
|
-use data\model\HealhwordExcelModel;
|
|
|
-use jianyan\excel\Excel;
|
|
|
-use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
-use think\Config;
|
|
|
-use think\console\Command;
|
|
|
-use think\console\Input;
|
|
|
-use think\console\Output;
|
|
|
-use think\db\Where;
|
|
|
-use think\Exception;
|
|
|
-use think\facade\Db;
|
|
|
-use PHPExcel;
|
|
|
-
|
|
|
-class UserAddMachine extends Command
|
|
|
-{
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- protected function configure()
|
|
|
- {
|
|
|
- // 测试脚本
|
|
|
- $this->setName('user_add_machine')
|
|
|
- ->setDescription('the user_add_machine command');
|
|
|
- }
|
|
|
-
|
|
|
- protected function execute(Input $input, Output $output)
|
|
|
- {
|
|
|
-// $list = Db::name('money_log')->whereDay('create_at', 'today')->where('type', 6)->where('create_at', '>', '2023-02-15 08:58:23')->count('id');
|
|
|
-// $output->writeln('key'.$list);
|
|
|
-
|
|
|
- #========================================================== 扣除多余一次
|
|
|
- Db::startTrans();
|
|
|
- try {
|
|
|
-
|
|
|
-
|
|
|
- $list = Db::name('money_log')->whereDay('create_at', 'today')->where('type', 6)->field('uid')->group('uid')->select();
|
|
|
-
|
|
|
- foreach ($list as $key=>$val){
|
|
|
- $count = Db::name('money_log')->whereDay('create_at', 'today')->where('type', 6)->where('uid', $val['uid'])->count('id');
|
|
|
-// if ($count != 2){
|
|
|
-//
|
|
|
-// }
|
|
|
-// $output->writeln('uid:'.$count);
|
|
|
- if ($count == 2){
|
|
|
- $logs = Db::name('money_log')->whereDay('create_at', 'today')->where('type', 6)->where('uid', $val['uid'])->select();
|
|
|
- if ($logs[0]['money'] == $logs[1]['money']){
|
|
|
-// $output->writeln('0mongey:'.$logs[0]['money'].'--'.'1money:'.$logs[1]['money']);
|
|
|
-// $output->writeln('uid:'.$val['uid']);
|
|
|
- $user_info = Db::name('user')->where('id',$val['uid'])->find();
|
|
|
- if ($user_info['money'] < $logs[0]['money']){
|
|
|
- sr_throw('不够扣除');
|
|
|
- }else{
|
|
|
- edit_user_money(14, $val['uid'], $logs[0]['money']);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- Db::commit();
|
|
|
- }catch (\Exception $e){
|
|
|
- Db::rollback();
|
|
|
- $output->writeln('error:'.$e->getMessage());
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- return 22;
|
|
|
-
|
|
|
- #========================================================== 扣除多余一次
|
|
|
-
|
|
|
- #========================================================== 扣除多余一次
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // 团队跑数据
|
|
|
-// Db::name('box_handle')->whereDay('create_time', 'yesterday')->save(['is_team_handle'=>0]);
|
|
|
-// return 33;
|
|
|
-
|
|
|
- // 减去领取团队奖金错误数据
|
|
|
-// Db::startTrans();
|
|
|
-// try {
|
|
|
-//
|
|
|
-// $list = Db::name('money_log1')->where('id', '>', 0)->select();
|
|
|
-// foreach ($list as $key=>$val){
|
|
|
-// $user_info = Db::name('user')->where('id', $val['uid'])->find();
|
|
|
-// if ($user_info['today_money'] >= $val['money']){
|
|
|
-// Db::name('user')->where('id', $val['uid'])->dec('today_money', floatval($val['money']))->update();
|
|
|
-// Db::name('user')->where('id', $val['uid'])->dec('todayaward_money', floatval($val['money']))->update();
|
|
|
-// }else{
|
|
|
-// $output->writeln('error:'.$val['id']);
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// Db::commit();
|
|
|
-// }catch (\Exception $e){
|
|
|
-// Db::rollback();
|
|
|
-// $output->writeln('error:'.$e->getMessage());
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// return 33;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-// Db::startTrans();
|
|
|
-// try {
|
|
|
-//
|
|
|
-// // 总共用户的盒子累计 计算
|
|
|
-// $list1 = Db::name('box_record')->group('uid')->field('uid')->select();
|
|
|
-// foreach ($list1 as $key=>$val){
|
|
|
-// $output->writeln('key'.$key);
|
|
|
-// $total = Db::name('box_record')->where('uid', $val['uid'])->sum('num');
|
|
|
-// $box10 = Db::name('box_record')->where('uid', $val['uid'])->sum('box10');
|
|
|
-// $box20 = Db::name('box_record')->where('uid', $val['uid'])->sum('box20');
|
|
|
-// $box30 = Db::name('box_record')->where('uid', $val['uid'])->sum('box30');
|
|
|
-// $box40 = Db::name('box_record')->where('uid', $val['uid'])->sum('box40');
|
|
|
-// if ($total> ($box10+$box20+$box30+$box40)){
|
|
|
-// $null_count = $total- ($box10+$box20+$box30+$box40);
|
|
|
-// // 如果有空盒
|
|
|
-// Db::name('user')->where('id', $val['uid'])->inc('total_null_box', $null_count)->update();
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 增加其他盒子个数
|
|
|
-// Db::name('user')->where('id', $val['uid'])->inc('box10', $box10)->inc('box20', $box20)->inc('box30', $box30)->inc('box40', $box40)->update();
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// Db::commit();
|
|
|
-// }catch (\Exception $e){
|
|
|
-// Db::rollback();
|
|
|
-//
|
|
|
-// $output->writeln('key'.$e->getMessage());
|
|
|
-// }
|
|
|
-//
|
|
|
-// return 33;
|
|
|
-
|
|
|
-
|
|
|
-// 所有用户领取 奖金
|
|
|
-// Db::startTrans();
|
|
|
-// try {
|
|
|
-// // 所有用户领取 奖金
|
|
|
-// $model_user = new UserModel();
|
|
|
-// $list = $model_user->where('today_money', '>', 0)->field('*')->select();
|
|
|
-// $output->writeln('key'.count($list));
|
|
|
-//
|
|
|
-// foreach ($list as $key=>$val){
|
|
|
-// $output->writeln('key'.$key);
|
|
|
-// edit_user_money(6, $val['id'], $val['today_money']);
|
|
|
-// Db::name('user')->where('id', $val['id'])->save([
|
|
|
-// 'today_money'=>0
|
|
|
-// ]);
|
|
|
-// // 累计奖金
|
|
|
-// Db::name('user')->where('id', $val['id'])->inc('todayaward_money', floatval($val['today_money']))->update();
|
|
|
-// }
|
|
|
-//
|
|
|
-// Db::commit();
|
|
|
-// }catch (\Exception $e){
|
|
|
-// Db::rollback();
|
|
|
-// $output->writeln('key'.$e->getMessage());
|
|
|
-//
|
|
|
-// }
|
|
|
-// return 44;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // 提现失败两次回调数据(1.直接扣除 2.标记)
|
|
|
- Db::startTrans();
|
|
|
- try {
|
|
|
- $this->getCoupon($input, $output);
|
|
|
- Db::commit();
|
|
|
- }catch (\Exception $e){
|
|
|
- Db::rollback();
|
|
|
-
|
|
|
- $output->writeln('error:'.$e->getMessage());
|
|
|
-
|
|
|
- }
|
|
|
- return 33;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $money = Db::name('user')->where('id', '>', 0)->sum('money');
|
|
|
- $score = Db::name('user')->where('id', '>', 0)->sum('score');
|
|
|
- $output->writeln('money:'.$money.',score:'.$score);
|
|
|
- return 33;
|
|
|
-
|
|
|
- Db::name('box_record')->where('create_time', '>', '2023-02-13 10:48:17')->save([
|
|
|
- 'status'=>1
|
|
|
- ]);
|
|
|
-
|
|
|
- return 33;
|
|
|
- Db::startTrans();
|
|
|
- try {
|
|
|
-
|
|
|
-
|
|
|
- $model = new ShopGoodsModel();
|
|
|
- $goods_arr = $model
|
|
|
- ->where('box_type', 20)
|
|
|
- ->where('goods_type', 2)
|
|
|
- ->where('goods_id', 'not in', explode('|', env('APP.NOT_OPEN_GOODS_ID')))
|
|
|
- ->field('goods_id,box_type,goods_img,price,goods_name')
|
|
|
-// ->field('goods_id,box_type')
|
|
|
- ->page(1, 20)
|
|
|
- ->select();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $datas = Db::name('box_mid_handle')->where('status', 1)->where('goods_id', 346)->select();
|
|
|
-
|
|
|
- foreach ($datas as $key=>$val){
|
|
|
- $rand_num = random_int(0, 16);
|
|
|
- $goods_info = $goods_arr[$rand_num];
|
|
|
- Db::name('box_mid_handle')->where('id', $val['id'])->save([
|
|
|
- 'goods_price'=>$goods_info['price'],
|
|
|
- 'goods_id'=>$goods_info['goods_id']
|
|
|
- ]);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- Db::commit();
|
|
|
- }catch (\Exception $e){
|
|
|
- Db::rollback();
|
|
|
-
|
|
|
- $output->writeln('error:'.$e->getMessage());
|
|
|
- }
|
|
|
-// $output->writeln('key'.count($datas));
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-// $output->writeln(json_encode($goods_arr));
|
|
|
-
|
|
|
- return 33;
|
|
|
-
|
|
|
-
|
|
|
- Db::name('user')->where('id', '>', 0)->save([
|
|
|
- 'total_team_withdraw'=>0
|
|
|
- ]);
|
|
|
-
|
|
|
-
|
|
|
- Db::startTrans();
|
|
|
- try {
|
|
|
- $list = Db::name('withdraw_log')->where('status', 1)->select();
|
|
|
- foreach ($list as $key=>$val){
|
|
|
- $user = Db::name('user')->where('id', $val['uid'])->find();
|
|
|
- Db::name('user')->whereIn('id', $user['path'])->inc('total_team_withdraw', $val['apply_money'])->update();
|
|
|
- Db::name('user')->whereIn('id', $user['id'])->inc('total_team_withdraw', $val['apply_money'])->update();
|
|
|
-
|
|
|
-// $output->writeln('key'.$key);
|
|
|
-// $count = Db::name('box_handle')->where('uid', $val['id'])->count('id');
|
|
|
-// if ($count>0){
|
|
|
-// Db::name('user')->where('id', 'in', $val['path'])->inc('total_team_box', $count)->update();
|
|
|
-// Db::name('user')->where('id', 'in', $val['path'])->inc('today_team_box', $count)->update();
|
|
|
-// Db::name('user')->where('id', $val['id'])->inc('total_box', $count)->inc('total_team_box', $count)->update();
|
|
|
-// }
|
|
|
- }
|
|
|
-
|
|
|
- Db::commit();
|
|
|
- }catch (\Exception $e){
|
|
|
- Db::rollback();
|
|
|
-
|
|
|
- $output->writeln('key'.$e->getMessage());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return 33;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return 33;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- Db::startTrans();
|
|
|
- try {
|
|
|
- $list = Db::name('user')->where('id', '>', 0)->select();
|
|
|
- foreach ($list as $key=>$val){
|
|
|
- $output->writeln('key'.$key);
|
|
|
- $count = Db::name('box_handle')->where('uid', $val['id'])->count('id');
|
|
|
- if ($count>0){
|
|
|
- Db::name('user')->where('id', 'in', $val['path'])->inc('total_team_box', $count)->update();
|
|
|
- Db::name('user')->where('id', 'in', $val['path'])->inc('today_team_box', $count)->update();
|
|
|
- Db::name('user')->where('id', $val['id'])->inc('total_box', $count)->inc('total_team_box', $count)->update();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- Db::commit();
|
|
|
- }catch (\Exception $e){
|
|
|
- Db::rollback();
|
|
|
-
|
|
|
- $output->writeln('key'.$e->getMessage());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return 33;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- Db::startTrans();
|
|
|
- try {
|
|
|
-
|
|
|
- $list = Db::name('box_mid_handle')->where('goods_id', 0)->where('status', 2)->select();
|
|
|
-
|
|
|
-
|
|
|
- foreach ($list as $key=>$val){
|
|
|
- edit_user_score(2, $val['uid'], env('boxsetting.ONE_BOX_PRICE'), $val['id']);
|
|
|
- }
|
|
|
- Db::commit();
|
|
|
- }catch (\Exception $e){
|
|
|
- Db::rollback();
|
|
|
-
|
|
|
- $output->writeln('key'.$e->getMessage());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return 33;
|
|
|
- Db::startTrans();
|
|
|
- try {
|
|
|
- // 批量设置用户等级
|
|
|
- $this->settingUserLevels();
|
|
|
-
|
|
|
- // 添加用户数据
|
|
|
-// $this->addUser($input, $output);
|
|
|
-
|
|
|
- // 自动预约福袋
|
|
|
-// $this->buyBoxBefore();
|
|
|
-
|
|
|
-
|
|
|
-// $list = Db::name('box_mid_handle')->where('id', '>', 0)->select();
|
|
|
-// foreach ($list as $key=>$val){
|
|
|
-// $output->writeln('key'.$key);
|
|
|
-// if (!Db::name('shop_goods')->where('goods_id', $val['goods_id'])->find()){
|
|
|
-// sr_throw('error:'.$val['goods_id']);
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
- // 后台匹配开奖
|
|
|
-// $this->systemHandleBox($input, $output);
|
|
|
-
|
|
|
- // 匹配开奖
|
|
|
-// $this->recordBoxAppointToMiddle($input, $output);
|
|
|
-
|
|
|
- // 更正中间表数据问题
|
|
|
-// $this->updateMiddleExcelData($input, $output);
|
|
|
-
|
|
|
- // 所有用户添加 积余额
|
|
|
-// Db::name('user')->where('id', '>', 0)->inc('money', 20000)->update();
|
|
|
-// Db::name('user')->where('id', '>', 0)->inc('score', 20000)->update();
|
|
|
-
|
|
|
-
|
|
|
- Db::commit();
|
|
|
- }catch (\Exception $e){
|
|
|
- Db::rollback();
|
|
|
-
|
|
|
- $output->writeln('error:'.$e->getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- return 22;
|
|
|
- }
|
|
|
-
|
|
|
- protected function getCoupon(Input $input, Output $output){
|
|
|
-
|
|
|
- // 扣除提现失败扣除钱
|
|
|
- $arr = [['uid'=>5344726,'money'=>'2925'],
|
|
|
- ['uid'=>5346144,'money'=>'4275.5'],
|
|
|
- ['uid'=>5346574,'money'=>'1386'],
|
|
|
- ['uid'=>5345815,'money'=>'1386'],
|
|
|
- ['uid'=>5346314,'money'=>'6444'],
|
|
|
- ['uid'=>5346169,'money'=>'1296'],
|
|
|
- ['uid'=>5344735,'money'=>'7902'],
|
|
|
- ['uid'=>5344962,'money'=>'1620'],
|
|
|
- ['uid'=>5345983,'money'=>'1476'],
|
|
|
- ['uid'=>5346095,'money'=>'1476'],
|
|
|
- ['uid'=>5346630,'money'=>'1026'],
|
|
|
- ['uid'=>5345797,'money'=>'333'],
|
|
|
- ['uid'=>5344556,'money'=>'1080'],
|
|
|
- ['uid'=>5346487,'money'=>'2772'],
|
|
|
- ['uid'=>5346035,'money'=>'5517'],
|
|
|
- ['uid'=>5346577,'money'=>'1728'],
|
|
|
- ['uid'=>5346194,'money'=>'1314'],
|
|
|
- ['uid'=>5346153,'money'=>'1125'],
|
|
|
- ['uid'=>5344956,'money'=>'3240'],
|
|
|
- ['uid'=>5346602,'money'=>'1386'],
|
|
|
- ['uid'=>5346174,'money'=>'1080'],
|
|
|
- ['uid'=>5346083,'money'=>'1476'],
|
|
|
- ['uid'=>5345569,'money'=>'1440'],
|
|
|
- ['uid'=>5345972,'money'=>'999'],
|
|
|
- ['uid'=>5346595,'money'=>'1386'],
|
|
|
- ['uid'=>5346491,'money'=>'1530'],
|
|
|
- ['uid'=>5346604,'money'=>'864'],
|
|
|
- ['uid'=>5346543,'money'=>'1080'],
|
|
|
- ['uid'=>5344866,'money'=>'1620'],
|
|
|
- ['uid'=>5345936,'money'=>'2736'],
|
|
|
- ['uid'=>5346610,'money'=>'4239'],
|
|
|
- ['uid'=>5344527,'money'=>'1260'],
|
|
|
- ['uid'=>5344734,'money'=>'1035'],
|
|
|
- ['uid'=>5345960,'money'=>'864'],
|
|
|
- ['uid'=>5345622,'money'=>'2790'],
|
|
|
- ['uid'=>5345876,'money'=>'7299'],
|
|
|
- ['uid'=>5345926,'money'=>'1620'],
|
|
|
- ['uid'=>5346163,'money'=>'2016'],
|
|
|
- ['uid'=>5346102,'money'=>'864'],
|
|
|
- ['uid'=>5345812,'money'=>'1890'],
|
|
|
- ['uid'=>5344948,'money'=>'1080']];
|
|
|
-
|
|
|
-
|
|
|
- $sum = 0;
|
|
|
- foreach ($arr as $key=>$val){
|
|
|
- $output->writeln('key'.$key);
|
|
|
- $user_info = Db::name('user')->where('id', $val['uid'])->find();
|
|
|
- $users_money = $user_info['money']+$user_info['score'];
|
|
|
-
|
|
|
- $withdraing = Db::name('withdraw_log')->where('uid', $val['uid'])->where('status', 0)->sum('apply_money');
|
|
|
-
|
|
|
-
|
|
|
- if ($val['money'] > ($users_money+$withdraing)){
|
|
|
-// $sum += ($val['money']-$users_money-$withdraing);
|
|
|
-// $output->writeln('uid:'.$val['uid']);
|
|
|
- // 标记路线
|
|
|
- Db::name('user')->where('id', $val['uid'])->save(['luzi_money'=>$val['money']]);
|
|
|
- }else{
|
|
|
- // 够扣除
|
|
|
- // 退还提现申请到余额
|
|
|
- $list = Db::name('withdraw_log')->where('uid', $val['uid'])->where('status', 0)->select();
|
|
|
- foreach ($list as $key1=>$val1){
|
|
|
- Db::name('withdraw_log')->where('id', $val1['id'])->save(['status'=> 3, 'fail_log'=>'提现多次返回']);
|
|
|
- edit_user_money(10, $val1['uid'], $val1['apply_money']);
|
|
|
- $output->writeln('提现处理:id:'.$val1['id']);
|
|
|
- }
|
|
|
-
|
|
|
- $cur_score = $user_info['score'];
|
|
|
- // 是否还是扣除余额
|
|
|
- $has_lessmoney = false;
|
|
|
-
|
|
|
- if ($val['money'] > $cur_score){
|
|
|
- edit_user_score(4, $val['uid'], $cur_score);
|
|
|
- $has_lessmoney = true;
|
|
|
- }else{
|
|
|
- edit_user_score(4, $val['uid'], $val['money']);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if ($has_lessmoney){
|
|
|
- edit_user_money(11, $val['uid'], ($val['money']-$cur_score));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-// $less_money = $val['money']-$cur_score;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-// $output->writeln('亏损:'.$sum);
|
|
|
-
|
|
|
-
|
|
|
- return 33;
|
|
|
-
|
|
|
-// $list = Db::name('withdraw_log')->where('status', 3)->where('create_at', '>', '2023-02-13 23:23:45')->select();
|
|
|
- $list = Db::name('withdraw_log')->where('status', 3)->select();
|
|
|
- $arr = [];
|
|
|
- foreach ($list as $key =>$val){
|
|
|
-// $count = Db::name('money_log')->where('uid', $val['uid'])->where('create_at', '>', '2023-02-13 23:23:45')->where('type', 10)->count();
|
|
|
- $count = Db::name('money_log')->where('uid', $val['uid'])->where('type', 10)->count();
|
|
|
-
|
|
|
- if ($count > 1){
|
|
|
- if (!isset($arr[$val['uid']])){
|
|
|
- $arr[$val['uid']] = 1;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $output->writeln(json_encode(array_keys($arr)));
|
|
|
-
|
|
|
-
|
|
|
- return 33;
|
|
|
-
|
|
|
-
|
|
|
- $arr = [
|
|
|
- ['number'=>'WD534657849545610251','name'=>'杨玉婷','zfb_number'=>'19169946597'],
|
|
|
- ['number'=>'WD534473598565349555','name'=>'刘芳','zfb_number'=>'2765728677@qq.com'],
|
|
|
- ['number'=>'WD534581550101505556','name'=>'刘健','zfb_number'=>'15698096367'],
|
|
|
- ['number'=>'WD534495657509850999','name'=>'张镇强','zfb_number'=>'15374723581'],
|
|
|
- ['number'=>'WD534648753545510148','name'=>'周鹏','zfb_number'=>'18549818699'],
|
|
|
- ['number'=>'WD534649152994855515','name'=>'汪川','zfb_number'=>'15961266732'],
|
|
|
- ['number'=>'WD534592655981001019','name'=>'郭景辉','zfb_number'=>'19922439523'],
|
|
|
- ['number'=>'WD534496848535749545','name'=>'陈伟','zfb_number'=>'499558005@qq.com'],
|
|
|
- ['number'=>'WD534630256991001005','name'=>'1630','zfb_number'=>'13265262521'],
|
|
|
- ['number'=>'WD534494850989898544','name'=>'魏秀军','zfb_number'=>'13543736731'],
|
|
|
- ['number'=>'WD534618452575697519','name'=>'薛永浩','zfb_number'=>'19865924544'],
|
|
|
- ['number'=>'WD534683810150521005','name'=>'尹荐','zfb_number'=>'18686073199'],
|
|
|
- ['number'=>'WD534455655981015552','name'=>'吴浩友','zfb_number'=>'15959096295'],
|
|
|
- ['number'=>'WD534619410250495557','name'=>'岳庆庆','zfb_number'=>'15935905192'],
|
|
|
- ['number'=>'WD534587610050100985','name'=>'郝健','zfb_number'=>'244788081@qq.com'],
|
|
|
- ['number'=>'WD534660248101524910','name'=>'朱兰','zfb_number'=>'18661245016'],
|
|
|
- ['number'=>'WD534473551485255971','name'=>'刘芳','zfb_number'=>'17836372202'],
|
|
|
- ['number'=>'WD534473599515197501','name'=>'刘芳','zfb_number'=>'17836372202'],
|
|
|
- ['number'=>'WD534654348555397545','name'=>'潘细舟','zfb_number'=>'18071855406'],
|
|
|
- ['number'=>'WD534660210299975198','name'=>'朱兰','zfb_number'=>'18661245016'],
|
|
|
- ['number'=>'WD534472651495357481','name'=>'丁小文','zfb_number'=>'13983952207'],
|
|
|
- ['number'=>'WD534455649100975548','name'=>'吴浩友','zfb_number'=>'15959096295'],
|
|
|
- ['number'=>'WD534473556559852539','name'=>'刘芳','zfb_number'=>'2765728677@qq.com'],
|
|
|
- ['number'=>'WD534619410299102995','name'=>'岳庆庆','zfb_number'=>'15935905192'],
|
|
|
- ['number'=>'WD534472650571025699','name'=>'丁小文','zfb_number'=>'13983952207'],
|
|
|
- ['number'=>'WD534593656519852101','name'=>'王毅','zfb_number'=>'13128820934'],
|
|
|
- ['number'=>'WD534615354985156505','name'=>'相安家','zfb_number'=>'407113438@qq.com'],
|
|
|
- ['number'=>'WD534641951100535649','name'=>'覃程','zfb_number'=>'15878811470'],
|
|
|
- ['number'=>'WD534533810151575699','name'=>'何喜','zfb_number'=>'何喜'],
|
|
|
- ['number'=>'WD534472657575149995','name'=>'丁小文','zfb_number'=>'13983952207'],
|
|
|
- ['number'=>'WD534592654101525653','name'=>'郭景辉','zfb_number'=>'19922439523'],
|
|
|
- ['number'=>'WD534603599101565797','name'=>'粟明伟','zfb_number'=>'18520698032'],
|
|
|
- ['number'=>'WD534503510250999753','name'=>'魏国杰','zfb_number'=>'13861684504'],
|
|
|
- ['number'=>'WD534608399491015250','name'=>'林凯伦','zfb_number'=>'13829526420'],
|
|
|
- ['number'=>'WD534473456535410149','name'=>'贺柳涛','zfb_number'=>'17347590878'],
|
|
|
- ['number'=>'WD534450149485410155','name'=>'冯永枭','zfb_number'=>'18957811849'],
|
|
|
- ['number'=>'WD534496253549949975','name'=>'卢芹芳','zfb_number'=>'13764869782'],
|
|
|
- ['number'=>'WD534451657100569952','name'=>'刘媛媛','zfb_number'=>'18875230706'],
|
|
|
- ['number'=>'WD534514049525310298','name'=>'任细虹','zfb_number'=>'15159758937'],
|
|
|
- ['number'=>'WD534616998505010151','name'=>'刘桂杰','zfb_number'=>'15624852973'],
|
|
|
- ['number'=>'WD534631454561005252','name'=>'刘光荣','zfb_number'=>'15625282199'],
|
|
|
- ['number'=>'WD534609555525198100','name'=>'吴优','zfb_number'=>'13664011167'],
|
|
|
- ['number'=>'WD534472899515549981','name'=>'王静','zfb_number'=>'18696475281'],
|
|
|
- ['number'=>'WD534657455985310157','name'=>'余汉','zfb_number'=>'15672642936'],
|
|
|
- ['number'=>'WD534610253509997481','name'=>'马钰琪','zfb_number'=>'18047125331'],
|
|
|
- ['number'=>'WD534599557555410256','name'=>'吴优','zfb_number'=>'13664011167'],
|
|
|
- ['number'=>'WD534495657535110099','name'=>'张镇强','zfb_number'=>'13850404031'],
|
|
|
- ['number'=>'WD534581551101541024','name'=>'刘健','zfb_number'=>'15698096367'],
|
|
|
- ['number'=>'WD534617410049525198','name'=>'李小松','zfb_number'=>'www424684642@163.com'],
|
|
|
- ['number'=>'WD534562254505210153','name'=>'郑毅','zfb_number'=>'18972923284'],
|
|
|
- ['number'=>'WD534598898545597579','name'=>'马钰琪','zfb_number'=>'18047125331'],
|
|
|
- ['number'=>'WD534592653504949529','name'=>'郭景辉','zfb_number'=>'19922439523'],
|
|
|
- ['number'=>'WD534598352505656100','name'=>'吴优','zfb_number'=>'13664011167'],
|
|
|
- ['number'=>'WD534452799101535797','name'=>'罗鱼谜','zfb_number'=>'17612872572'],
|
|
|
- ['number'=>'WD534452754575753539','name'=>'罗鱼谜','zfb_number'=>'17612872572'],
|
|
|
- ['number'=>'WD534450110110052100','name'=>'冯永枭','zfb_number'=>'18957811849'],
|
|
|
- ['number'=>'WD534619497495510254','name'=>'岳庆庆','zfb_number'=>'15935905192'],
|
|
|
- ['number'=>'WD534615348995554101','name'=>'岳庆庆','zfb_number'=>'15935905192'],
|
|
|
- ['number'=>'WD534625157101511005','name'=>'王山','zfb_number'=>'13356299904'],
|
|
|
- ['number'=>'WD534614410053995310','name'=>'万福宝','zfb_number'=>'18813135231'],
|
|
|
- ['number'=>'WD534642356515610153','name'=>'凌思林','zfb_number'=>'15279507826'],
|
|
|
- ['number'=>'WD534461710251515248','name'=>'刘海武','zfb_number'=>'15858128789'],
|
|
|
- ['number'=>'WD534593650564910255','name'=>'王毅','zfb_number'=>'13128820934'],
|
|
|
- ['number'=>'WD534593648975156505','name'=>'王金柱','zfb_number'=>'13139522808'],
|
|
|
- ['number'=>'WD534631450499810010','name'=>'刘光荣','zfb_number'=>'15625282199'],
|
|
|
- ['number'=>'WD534660410197515048','name'=>'洪芳芳','zfb_number'=>'13922282065'],
|
|
|
- ['number'=>'WD534617497575253985','name'=>'李小松','zfb_number'=>'15829099670'],
|
|
|
- ['number'=>'WD534614454974856981','name'=>'万福宝','zfb_number'=>'18813135231'],
|
|
|
- ['number'=>'WD534556956534910210','name'=>'楚强强','zfb_number'=>'18656948213'],
|
|
|
- ['number'=>'WD534593699102515257','name'=>'王金柱','zfb_number'=>'13139522808'],
|
|
|
- ['number'=>'WD534608557971019849','name'=>'陈伟','zfb_number'=>'17874017301'],
|
|
|
- ['number'=>'WD534655751975797519','name'=>'杨玉婷','zfb_number'=>'19169946597'],
|
|
|
- ['number'=>'WD534603510099101485','name'=>'粟明伟','zfb_number'=>'18520698032'],
|
|
|
- ['number'=>'WD534485055994910049','name'=>'谢谊春','zfb_number'=>'1515354567@qq.com'],
|
|
|
- ['number'=>'WD534649150975650541','name'=>'汪川','zfb_number'=>'15961266732'],
|
|
|
- ['number'=>'WD534661055545751984','name'=>'程利峰','zfb_number'=>'17320678688'],
|
|
|
- ['number'=>'WD534663010054100100','name'=>'吴优','zfb_number'=>'16271845555'],
|
|
|
- ['number'=>'WD534615299511025199','name'=>'岳庆庆','zfb_number'=>'15935905192'],
|
|
|
- ['number'=>'WD534597254501029710','name'=>'楚强强','zfb_number'=>'18788877745'],
|
|
|
- ['number'=>'WD534657749505348571','name'=>'宋杨','zfb_number'=>'15232797156'],
|
|
|
- ['number'=>'WD534581297102489849','name'=>'魏大江','zfb_number'=>'18883588210'],
|
|
|
- ['number'=>'WD534486656485298545','name'=>'王姣','zfb_number'=>'13731201128'],
|
|
|
- ['number'=>'WD534676453979799545','name'=>'伍锦胜','zfb_number'=>'13432206140'],
|
|
|
- ['number'=>'WD534587653545556531','name'=>'郝健','zfb_number'=>'18562365150'],
|
|
|
- ['number'=>'WD534579749975397569','name'=>'吴小亮','zfb_number'=>'15298603353'],
|
|
|
- ['number'=>'WD534650998505752519','name'=>'董妍','zfb_number'=>'15021300080'],
|
|
|
- ['number'=>'WD534494851535510153','name'=>'魏秀军','zfb_number'=>'13543736731'],
|
|
|
- ['number'=>'WD534583810054100565','name'=>'王奋强','zfb_number'=>'13387137935'],
|
|
|
- ['number'=>'WD534596054100574810','name'=>'邵小斌','zfb_number'=>'18393825795'],
|
|
|
- ['number'=>'WD534616356101995298','name'=>'马梓浩','zfb_number'=>'17710404082'],
|
|
|
- ['number'=>'WD534659551495755985','name'=>'楚强强','zfb_number'=>'396746095@qq.com'],
|
|
|
- ['number'=>'WD534593610051525655','name'=>'王毅','zfb_number'=>'13128820934'],
|
|
|
- ['number'=>'WD534654355975548995','name'=>'邓丽','zfb_number'=>'18171692670'],
|
|
|
- ['number'=>'WD534451652535050101','name'=>'刘媛媛','zfb_number'=>'18875230706'],
|
|
|
- ['number'=>'WD534631450545652575','name'=>'刘光荣','zfb_number'=>'15625282199'],
|
|
|
- ['number'=>'WD534603510010010010','name'=>'唐慧','zfb_number'=>'1693770147@qq.com']
|
|
|
- ];
|
|
|
-
|
|
|
- $count = 0;
|
|
|
- foreach ($arr as $key=>$val){
|
|
|
- if (!Db::name('withdraw_log')->where('status', 3)->where('create_at', '>', '2023-02-13 23:30:30')->where('zfb_number', $val['zfb_number'])->find()){
|
|
|
-// ++$count;
|
|
|
- $output->writeln('number:'.$val['number']);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $output->writeln('count:'.$count);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- public static function get_date_by_excel($date){
|
|
|
- if (!$date || $date == '0000-00-00') return null;
|
|
|
-
|
|
|
- $unix_time = \PHPExcel_Shared_Date::ExcelToPHP($date);
|
|
|
-
|
|
|
- return gmdate('Y-m-d H:i',$unix_time);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- protected function updateMiddleExcelData($input, $output){
|
|
|
-
|
|
|
- $list = Db::name('box_mid_handle')->where('id', '>', 0)->select();
|
|
|
-// $output->writeln('key'.json_encode($list));
|
|
|
-// sr_throw();
|
|
|
- foreach ($list as $key=>$val){
|
|
|
-
|
|
|
- $output->writeln('key'.$key);
|
|
|
-
|
|
|
- if (empty($val['pay_type'])){
|
|
|
- $pay_type = Db::name('box_record')->where('id', $val['rid'])->value('pay_type');
|
|
|
-// sr_throw($pay_type);
|
|
|
- Db::name('box_mid_handle')->where('id', $val['id'])->save(['pay_type'=>$pay_type]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- protected function recordBoxAppointToMiddle($input, $output){
|
|
|
-
|
|
|
- $list = Db::name('box_record')->where('status', 1)->select()->toArray();
|
|
|
-
|
|
|
- $mid_arrs = [];
|
|
|
- $r_ids = [];
|
|
|
-
|
|
|
- $cur_time = sr_getcurtime(time());
|
|
|
- foreach ($list as $key=>$val){
|
|
|
- $total_goodsbox = $val['box10'] + $val['box20'] + $val['box30'] + $val['box40'];
|
|
|
-
|
|
|
- $r_goodsids = '';
|
|
|
-
|
|
|
- // 如果有空盒
|
|
|
- if ($val['num'] > $total_goodsbox){
|
|
|
- for ($i=0;$i < $val['num']-$total_goodsbox;$i++){
|
|
|
- $mid_arrs[] = [
|
|
|
- 'h_sn'=>createdHandleOrderSn(),
|
|
|
- 'uid'=>$val['uid'],
|
|
|
- 'rid'=>$val['id'],
|
|
|
- 'goods_id'=>0,
|
|
|
- 'create_time'=>$cur_time,
|
|
|
- 'box_type'=>0,
|
|
|
- 'goods_price'=>0
|
|
|
- ];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-// if (1 == 1){
|
|
|
-// sr_throw();
|
|
|
-// }
|
|
|
- // 其他盒子
|
|
|
- $box_arrs = [10, 20, 30, 40];
|
|
|
- foreach ($box_arrs as $key1=>$val1){
|
|
|
-
|
|
|
- $key_string = strval('box'.$val1);
|
|
|
- $box_goodsnum = $val[$key_string];
|
|
|
- $model = new ShopGoodsModel();
|
|
|
- $goods_arr = $model
|
|
|
- ->where('box_type', $val1)
|
|
|
- ->where('goods_type', 2)
|
|
|
- ->field('goods_id,box_type,goods_img,price,goods_name')
|
|
|
- ->page(1, 20)
|
|
|
- ->select();
|
|
|
-// ->select();
|
|
|
-// sr_throw(json_encode($goods_arr));
|
|
|
-
|
|
|
- if ($box_goodsnum > 0){
|
|
|
-
|
|
|
- // 如果后期要调整 取值 直接 排序 goods_arr
|
|
|
- for ($i = 0; $i < $box_goodsnum;$i++){
|
|
|
- $rand_num = mt_rand(0, count($goods_arr)-1);
|
|
|
-
|
|
|
-
|
|
|
- $goods = $goods_arr[$rand_num];
|
|
|
-
|
|
|
- $mid_arrs[] = [
|
|
|
- 'h_sn'=>createdHandleOrderSn(),
|
|
|
- 'uid'=>$val['uid'],
|
|
|
- 'rid'=>$val['id'],
|
|
|
- 'goods_id'=>$goods['goods_id'],
|
|
|
- 'create_time'=>$cur_time,
|
|
|
- 'box_type'=>$val1,
|
|
|
- 'goods_price'=>$goods['price']
|
|
|
- ];
|
|
|
- $r_goodsids .= ((empty($r_goodsids)?'':',').$goods['goods_id']);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- Db::name('box_record')->where('id', $val['id'])->save([
|
|
|
- 'status'=>2,
|
|
|
- 'goods_ids'=>$r_goodsids
|
|
|
- ]);
|
|
|
- }
|
|
|
-
|
|
|
- $model = new BoxMidHandleModel();
|
|
|
- $model->insertAll($mid_arrs);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- public function systemHandleBox(Input $input, Output $output){
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- public function addUser(Input $input, Output $output){
|
|
|
-
|
|
|
- $users = $this->randomPhone(10);
|
|
|
-
|
|
|
- $pid_invitecode = 0;
|
|
|
- foreach ($users as $key=>$val){
|
|
|
- if (!Db::name('user')->where('mobile', $val)->find()){
|
|
|
- $services = new UserServices();
|
|
|
- $output->writeln('key'.$key);
|
|
|
- $uid = $services->userRegister([
|
|
|
- 'user_name'=>'db-'.$val,
|
|
|
- 'invite_code'=>($pid_invitecode==0?'03284278':$pid_invitecode),
|
|
|
- 'code'=>'111111',
|
|
|
- 'password'=>"TDFyZ3n\/5GksjKtjhj2G1w==",
|
|
|
- 'mobile'=>$val
|
|
|
- ]
|
|
|
- );
|
|
|
-
|
|
|
- $user_info = Db::name('user')->where('id', $uid)->find();
|
|
|
- $pid_invitecode = $user_info['code'];
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public function buyBoxBefore(){
|
|
|
- $users = Db::name('user')->where('money', '>', 0)->paginate(50)->toArray();
|
|
|
-
|
|
|
-
|
|
|
- $model = new BoxModel();
|
|
|
- foreach ($users['data'] as $key=>$val){
|
|
|
- $count = rand(0, 10);
|
|
|
- $model->beforeBuyBox($val['id'], ['box_id'=>23422, 'buy_count'=>$count, 'pay_type'=>rand(1,2)]);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-//随机生成n条手机号
|
|
|
- function randomPhone($n = 20)
|
|
|
- {
|
|
|
- $tel_arr = array(
|
|
|
- '130', '131', '132', '133', '134', '135', '136', '137', '138', '139', '144', '147', '150', '151', '152', '153', '155', '156', '157', '158', '159', '176', '177', '178', '180', '181', '182', '183', '184', '185', '186', '187', '188', '189',
|
|
|
- );
|
|
|
- for ($i = 0; $i < $n; $i++) {
|
|
|
- $tmp[] = $tel_arr[array_rand($tel_arr)] . mt_rand(1000, 9999) . mt_rand(1000, 9999);
|
|
|
- }
|
|
|
- return array_unique($tmp);
|
|
|
- }
|
|
|
-
|
|
|
- function settingUserLevels(){
|
|
|
-// $levels = [0, 1, 1, 3, 0, 2, 3, 1, 0];
|
|
|
-// $levels = [2, 3, 0, 3, 2, 1, 0, 3, 0];
|
|
|
-// $levels = [3, 0, 3, 2, 1, 2, 0, 3, 1];
|
|
|
-// $levels = [0, 3, 0, 3, 2, 3, 3, 0, 2];
|
|
|
-// $levels = [1, 2, 2, 1, 3, 0, 2, 1, 3];
|
|
|
- $levels = [3,0,3,2,2,3,0,3,1];
|
|
|
- $zero_uid = 5344487;
|
|
|
- foreach ($levels as $key=>$val){
|
|
|
- Db::name('user')->where('id', $zero_uid-$key)->save(['level'=>$val]);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-}
|