123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- namespace app\admin\command;
- use think\console\Command;
- use think\console\Input;
- use think\console\Output;
- use think\Db;
- class Test extends Command
- {
- protected function configure()
- {
- $this->setName('test')->setDescription('Here is the remark ');
- }
- protected function execute(Input $input, Output $output)
- {
- // $list =["CJ1745TKS","CJ1745TKR"];
- // foreach ($list as $key=>$value){
- $starttime = "2022-2-1 00:00:00";
- $expiretime = "2023-4-30 23:59:59";
- $username=229867;
- while ($username<=229999){
- $pasword = randomkeys(2).rand(1000,9999);
- $salt = makeSalt();
- $pas = sha1($pasword.$salt);
- $data=[
- "username"=>"CJ1745TKR".$username,
- "password"=>$pas,
- "account_type"=>2,
- "pwd"=>$pasword,
- "salt"=>$salt,
- "status"=>0,
- "is_del"=>0,
- "starttime"=>$starttime,
- "expiretime"=>$expiretime,
- "addtime"=>date("Y-m-d H:i:s"),
- "updatetime"=>date("Y-m-d H:i:s")
- ];
- $acccount = Db::name("account")->insert($data,false,true);
- if($acccount>0){
- $user=[
- "nickname"=>$username,
- "mobile"=>"",
- "avatar"=>"",
- "remark"=>"",
- "sex"=>"",
- "addtime"=>date("Y-m-d H:i:s"),
- "updatetime"=>date("Y-m-d H:i:s")
- ];
- $info = Db::name("account_info")->insert($user,false,true);
- if($info>0){
- $rela=["accountid"=>$acccount,"account_info"=>$info];
- $rela_acc=Db::name("rela_account")->insert($rela);
- if($rela_acc){
- $datas=[
- "accountid"=>$acccount,
- "stock_total"=>12,
- "stock_used"=>0,
- "stock_balance"=>12,
- "stock_delivery"=>0,
- "status"=>0,
- "is_del"=>0,
- "addtime"=>date("Y-m-d H:i:s"),
- "updatetime"=>date("Y-m-d H:i:s")
- ];
- $query =Db::name("account_stock")->insert($datas);
- $username++;
- continue;
- }
- }
- }
- break;
- // }
- }
- }
- }
|