zz před 4 roky
rodič
revize
1cd1034b0b

+ 0 - 118
app/Console/Commands/Book/BookAutoOffShelf.php

@@ -1,118 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: z-yang
- * Date: 2020/10/29
- * Time: 9:49
- */
-
-namespace App\Console\Commands\Book;
-
-use DB;
-use Illuminate\Console\Command;
-use App\Modules\Message\MessageNotify;
-
-class BookAutoOffShelf extends Command
-{
-    /**
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-    protected $signature = 'Book:BookAutoOffShelf';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = '自动下架';
-
-    private $emails = ['zhaojp@yqsd.net',
-        'songdb@yqsd.net','zhoulj@iqiyoo.com'
-    ];
-    //private $emails = ['zhaoy@zw88.net','baixq@zw88.net'];
-    /**
-     * Create a new command instance.
-     *
-     * @return void
-     */
-    public function __construct()
-    {
-        parent::__construct();
-    }
-
-    /**
-     * Execute the console command.
-     *
-     * @return mixed
-     */
-    public function handle(){
-        $this->start();
-    }
-
-
-    private function start(){
-        $day = date('Y-m-d',time()+86400*10);
-        $book = DB::table('book_configs')->where('is_on_shelf',2)
-            ->where('copyright_limit_data','<=',$day)
-            ->where('copyright_limit_data','>=',date('Y-m-d'))
-            ->select('bid','book_name','copyright_limit_data')
-            ->get();
-        $off_shelf_book = [];
-        $alert_book = [];
-        if($book){
-            foreach ($book as $item){
-                if($item->copyright_limit_data <= date('Y-m-d')){
-                    $off_shelf_book[] = ['bid'=>$item->bid,'book_name'=>$item->book_name];
-                }
-                if($item->copyright_limit_data == $day){
-                    $alert_book[] = ['bid'=>$item->bid,'book_name'=>$item->book_name];
-                }
-            }
-        }
-
-        //《陆先生的情之所至》将于2020.10.29日下架,请尽快确认!
-        if($alert_book){
-            $content = '';
-            foreach ($alert_book as $item_book){
-                $content .= sprintf('<p>《%s》将于%s日下架,请尽快确认!</p>',$item_book['book_name'],$day);
-            }
-            $this->warning('[网读]书籍下架提醒',$content);
-        }
-        if($off_shelf_book){
-            $to_insert = [];
-            $bid = [];
-            foreach ($off_shelf_book as $item){
-                $bid[] = $item['bid'];
-                $to_insert[] = [
-                    'bid' => $item['bid'],'book_name'=>$item['book_name'],'channel_name'=>'',
-                    'update_date' => date('Y-m-d'),'update_chapter_count'=>2,'update_words'=>1,
-                    'update_type' => 'onshelfstatus','operator'=>'command-Book:BookAutoOffShelf',
-                    'created_at' => date('Y-m-d H:i:s'),
-                    'updated_at' => date('Y-m-d H:i:s')
-                ];
-
-            }
-            DB::table('book_updates')->insert($to_insert);
-            DB::table('book_configs')->whereIn('bid',$bid)->update([
-                'is_on_shelf'=>4,'updated_at'=>date('Y-m-d H:i:s')
-            ]);
-        }
-    }
-
-
-
-    private function warning($subject,$msg){
-
-        $notify = MessageNotify::mail([
-            'to_emails' => implode(",", $this->emails),
-            'subject' => $subject,
-            'body' =>$msg,
-            'delay_times' => 0,
-        ]);
-        $notify->notify();
-        return ;
-    }
-
-}

+ 1 - 1
app/Console/Commands/BookAdjustOne.php

@@ -47,7 +47,7 @@ class BookAdjustOne extends Command
      * @param $bid
      */
     public function adjustSequentOne($bid){
-        $chapter_list = DB::table('chapters')->orderBy('sequence')->where('bid',$bid)->get();
+        $chapter_list = DB::table('chapters')->orderBy('sequence')->where('bid',$bid)->select('id')->get();
         $prev = 0;
 
         foreach ($chapter_list as $chapter){

+ 2 - 9
app/Console/Commands/BookAfterSpider.php

@@ -65,7 +65,6 @@ class BookAfterSpider extends Command
         $this->addbookConfig($bid);
         $this->bookChapterInfo($bid);
         $this->adjustSequentOne($bid);
-        //ChapterService::splitContentAll($bid);
     }
 
     private function addproducts()
@@ -88,16 +87,10 @@ class BookAfterSpider extends Command
         $book_info = DB::table('books')->where('id', $bid)->first();
         $book_config = DB::table('book_configs')->where('bid', $bid)->first();
         if ($book_config) {
-            if ($book_info->ly_bid) {
-                $cp = $this->getcp($book_info->ly_bid);
-                DB::table('book_configs')->where('bid', $bid)->update(['cp_source' => $cp]);
-            }
+            return ;
         } else {
             $cp = '';
-            if ($book_info->ly_bid) {
-                $cp = $this->getcp($book_info->ly_bid);
-            }
-            $product_id = $this->addproducts();
+            $product_id = 0;
             $vip_seq = 0;
             $vip = DB::table('chapters')->where('bid', $bid)->where('is_vip', 1)->select('sequence')->orderBy('sequence')->first();
             if ($vip && isset($vip->sequence)) {

+ 0 - 104
app/Console/Commands/CheckBookCover.php

@@ -1,104 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: tandunzhao
- * Date: 2017/11/20
- * Time: 下午5:26
- */
-
-namespace App\Console\Commands;
-
-use App\Modules\Book\Models\BookConfig;
-use App\Modules\Statistic\Services\SendStatsEmailService;
-use GuzzleHttp\Client;
-use Illuminate\Console\Command;
-use Log;
-
-class CheckBookCover extends Command
-{
-    /**
-     * 执行命令 检查图书封面
-     *
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-    protected $signature = 'check_book_cover_status';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = '检查图书封面';
-
-    /**
-     * Execute the console command.
-     *
-     * @return mixed
-     */
-    public function handle()
-    {
-        Log::info('CheckBookCover start command');
-        $this->loadBookCoverInfo();
-        Log::info('CheckBookCover end command');
-    }
-
-    function loadBookCoverInfo()
-    {
-        $pageCount = 0; //当前的页数(默认从0开始)
-        $pageSize = 200;//每页的条数
-        $totalCount = BookConfig::getBooksCount(); //总条数
-        $totalPageCount = Ceil($totalCount / $pageSize); ////总页数
-        Log::info('CheckBookCover totalCount is  ' . $totalCount);
-        Log::info('CheckBookCover totalPageCount is  ' . $totalPageCount);
-        $errorBookCoverArray = [];
-        $client = new Client(['timeout' => 3.0,]);
-        while ($pageCount < $totalPageCount) {
-            Log::info('CheckBookCover currentPageCount is: ' . $pageCount);
-            $books = BookConfig::getBookCoverInfos(false, $pageSize, $pageCount);
-            foreach ($books as $bookItem) {
-                $coverUrl = $bookItem->cover;
-                try {
-                    $response = $client->request('get', $coverUrl);
-                    $resultCode = $response->getStatusCode();
-                    //成功
-                    if ($resultCode == 200 || $resultCode == 302) {
-
-                    } else {
-                        Log::info('CheckBookCover load error');
-                        $errorBookCoverArray[] = $bookItem;
-                    }
-                } catch (\Exception $e) {
-                    Log::info('CheckBookCover load error');
-                    $errorBookCoverArray[] = $bookItem;
-                }
-            }
-            $pageCount++;
-        }
-
-        if ($errorBookCoverArray) {
-            Log::info('CheckBookCover need sendEmail');
-            $this->sendEmail($errorBookCoverArray);
-        } else {
-            Log::info('CheckBookCover not need sendEmail');
-        }
-    }
-
-    function sendEmail($errorBookCoverArray)
-    {
-        Log::info('CheckBookCover start sendEmail');
-        $to_user = array(
-            ['address'=>'songdb@iqiyoo.com','name'=>'songdb'],
-            ['address'=>'zhaojp@yqsd.net','name'=>'赵君平'],
-            ['address' => 'zhoulj@iqiyoo.com', 'name' => '周灵杰'],
-        );
-
-        $content = "<table border='1' cellpadding='10' cellspacing='0'><tr><td align='center'>id</td><td align='center'>书名</td><td align='center'>作者</td></tr>";
-        foreach ($errorBookCoverArray as $item) {
-            $content .= "<tr><td align='center'>{$item->bid}</td><td align='center'>{$item->book_name}</td><td align='center'>{$item->author}</td></tr>";
-        }
-        $content .= "</table>";
-        SendStatsEmailService::SendHtmlEmailWithAcce($to_user, ['subject' => date("Y-m-d", time()) . "追书云错误封面的书籍信息", 'body' => $content]);
-    }
-}

+ 0 - 46
app/Console/Commands/CpcAdvertise/AutoWithdraw.php

@@ -1,46 +0,0 @@
-<?php
-
-namespace App\Console\Commands\CpcAdvertise;
-
-use App\Modules\Book\Services\SuperiorHistoryBookService;
-use DB;
-use Illuminate\Console\Command;
-
-class AutoWithdraw extends Command
-{
-    /**
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-    protected $signature = 'CpcAdvertise:AutoWithdraw';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = 'cpc广告自动提现';
-
-    /**
-     * Create a new command instance.
-     *
-     * @return void
-     */
-    public function __construct()
-    {
-        parent::__construct();
-    }
-
-    /**
-     * Execute the console command.
-     *
-     * @return mixed
-     */
-    public function handle()
-    {
-        //
-
-
-    }
-}

+ 0 - 52
app/Console/Commands/CpcAdvertise/CpcBillTasks.php

@@ -1,52 +0,0 @@
-<?php
-
-namespace App\Console\Commands\CpcAdvertise;
-
-use App\Modules\Book\Services\SuperiorHistoryBookService;
-use App\Modules\CpcAdvertise\Services\ChannelBillsService;
-use App\Modules\CpcAdvertise\Services\CpcChannelStatsService;
-use DB;
-use Illuminate\Console\Command;
-
-class CpcBillTasks extends Command
-{
-    /**
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-    protected $signature = 'CpcAdvertise:bill_task';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = '广告结算';
-
-    /**
-     * Create a new command instance.
-     *
-     * @return void
-     */
-    public function __construct()
-    {
-        parent::__construct();
-    }
-
-    /**
-     * Execute the console command.
-     *
-     * @return mixed
-     */
-    public function handle()
-    {
-        //
-        //$date = date('Y-m-d',strtotime('-2 day'));
-        for($i=12;$i>=2;$i--){
-            $date = date('Y-m-d',strtotime('-'.$i.' day'));
-            ChannelBillsService::generate_bills($date);
-        }
-
-    }
-}

+ 0 - 48
app/Console/Commands/CpcAdvertise/MonthlyStatsTasks.php

@@ -1,48 +0,0 @@
-<?php
-
-namespace App\Console\Commands\CpcAdvertise;
-
-use App\Modules\Book\Services\SuperiorHistoryBookService;
-use App\Modules\CpcAdvertise\Services\ChannelBillsService;
-use App\Modules\CpcAdvertise\Services\CpcChannelStatsService;
-use DB;
-use Illuminate\Console\Command;
-
-class MonthlyStatsTasks extends Command
-{
-    /**
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-    protected $signature = 'CpcAdvertise:generate_month_data';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = '广告结算';
-
-    /**
-     * Create a new command instance.
-     *
-     * @return void
-     */
-    public function __construct()
-    {
-        parent::__construct();
-    }
-
-    /**
-     * Execute the console command.
-     *
-     * @return mixed
-     */
-    public function handle()
-    {
-        $start_time = date('Y-m-01',strtotime('-1 month'));
-        $end_time = date('Y-m-d',strtotime(date('Y-m-01').' -1 day'));
-        ChannelBillsService::generateMonthData($start_time,$end_time);
-    }
-}

+ 0 - 59
app/Console/Commands/DownPic.php

@@ -1,59 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: tandunzhao
- * Date: 2017/11/24
- * Time: 上午11:48
- */
-
-namespace App\Console\Commands;
-
-use Log;
-use App\Modules\Finance\Models\Bill;
-use GuzzleHttp;
-use Illuminate\Console\Command;
-use Storage;
-
-class DownPic extends Command
-{
-
-
-    /**
-     * 执行命令   php artisan bill_task
-     *
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-    protected $signature = 'down_pic';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = '下载图片';
-
-
-    public function handle() {
-        $client = new GuzzleHttp\Client();
-
-        $fp  = fopen(storage_path("app/abc.txt"), 'r');
-        $str = fread($fp,filesize(storage_path("app/abc.txt")));
-        $arraylist= explode("\n",$str);
-        for($i=0;$i<count($arraylist);$i++) //把它们全部输出来
-        {
-            if(!empty($arraylist[$i])) {
-                echo $arraylist[$i]."     \n";
-                $data = $client->request('GET', $arraylist[$i])->getBody()->getContents();
-                $filename = str_replace("http://cdn-novel.weituibao.com/", "", $arraylist[$i]);
-                echo $filename."     \n";
-
-                Storage::disk('local')->put($filename, $data);
-            }
-        }
-    }
-
-
-
-}

+ 0 - 214
app/Console/Commands/FailOrderAlert.php

@@ -1,214 +0,0 @@
-<?php
-
-namespace App\Console\Commands;
-
-use Illuminate\Console\Command;
-use App\Modules\Subscribe\Services\OrderService;
-use Redis;
-use App\Libs\SMS;
-use Log;
-use DB;
-use App\Jobs\SendTexts;
-class FailOrderAlert extends Command
-{
-    /**
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-    protected $signature = 'foa {--qrcode}';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = '失败订单预警';
-
-    /**
-     * Create a new command instance.
-     *
-     * @return void
-     */
-    public function __construct()
-    {
-        parent::__construct();
-    }
-
-    /**
-     * Execute the console command.
-     *
-     * @return mixed
-     */
-    public function handle()
-    {
-        $options = $this->option('qrcode');
-        if($options){
-            return $this->forceSubscribeErrorAlert();
-        } else{
-            $this->tooLongNoOrderAlert();
-            return  $this->start();
-
-        }
-    }
-
-    private function start(){
-        if(!$this->isCanAlert()) return 1;
-        $sorce = $this->getPaySource();
-        if(!$sorce){
-            return false;
-        }
-        foreach ($sorce as $v){
-            $is_all_fail= $this->isAllFail($v->source);
-            $too_long = $this->lastOrderTooLong();
-            $content = '';
-            if($is_all_fail){
-                $content = '订单预警,'.$v->source.'通道最近20个订单都是未支付订单,尽快排查';
-            }
-
-            if($too_long){
-                $content = $v->source.'通道最近半小时没有产生一条订单,尽快排查';
-            }
-            if(!$content) return 2;
-
-            $phone_arr = ['15868100210','15088790066','13858057394','18668029091','18668420256'];
-            //$phone_arr = ['18668029091'];
-            foreach ($phone_arr as $phone){
-                $this->sendAndRecord(1,$phone,$content);
-            }
-            $key = 'distribution_channel_id:orderalert';
-            $field = 'sendalert';
-            Redis::hset($key,$field,time());
-        }
-
-        return 3;
-
-    }
-
-    private function forceSubscribeErrorAlert(){
-        $errors = Redis::SMEMBERS('force_subscribe_qrcode:error');
-        if(!$errors){
-            return false;
-        }
-
-        $res = [];
-        foreach ($errors as $value){
-            $temp = explode('_',$value);
-            $res[$temp[0]][] = $temp[1];
-        }
-        $phone_arr = ['15868100210','15088790066','13858057394','18668029091','18668420256'];
-        //$phone_arr = ['18668029091'];
-        if($res){
-            foreach ($res as $k=>$v){
-                if(count($v) >= 5){
-                    $content = 'appid='.$k.'的公众号获取强关二维码出问题了!!,一分钟之内出现'.count($v).'次';
-                    foreach ($phone_arr as $phone){
-                        SMS::send($phone,$content);
-                    }
-                    //break;
-                }
-            }
-        }
-        Redis::srem('force_subscribe_qrcode:error',$errors);
-        return false;
-    }
-
-    private  function tooLongNoOrderAlert(){
-        $last = DB::table('orders')->orderBy('id','desc')->first();
-        if(time()-strtotime($last->created_at) >= 150){
-            $phone_arr = ['15868100210','15088790066','13858057394','18668029091','18668420256'];
-            //$phone_arr = ['18668029091'];
-            $content = '订单预警,最近两分半没有产生一条订单,尽快排查';
-            foreach ($phone_arr as $phone){
-                echo SMS::send($phone,$content);
-            }
-        }
-    }
-
-    private function getAllChannel(){
-        return OrderService::getAllChannelId();
-    }
-
-    private function getPaySource(){
-        $sql = 'select distinct pay_merchant_id from distribution_channels where pay_merchant_id <>0';
-        $res = DB::select($sql);
-        $id_array = [];
-        if($res){
-            foreach ($res as $v){
-                $id_array[] = $v->pay_merchant_id;
-            }
-        }
-        $ssql = 'select distinct source from pay_merchants where id in('.implode(',',$id_array).')';
-        $source = DB::select($ssql);;
-        return $source;
-    }
-    /**
-     * 最近20订单是否全部失败
-     * @param $channel
-     * @param int $num
-     * @return bool
-     */
-    private  function isAllFail($source,$num=20){
-        $order = OrderService::getLatestOrderByChannleId($source,$num);
-
-        if(!$order)  return false;
-        if($order && count($order) < $num){
-            return false;
-        }
-        foreach ($order as $val){
-            if($val->status == 'PAID'){
-                return false;
-            }
-
-        }
-        return true;
-    }
-
-    /**
-     * 最后一条订单距离现在是否超过半小时
-     * @return bool
-     */
-    private function lastOrderTooLong(){
-        $order = OrderService::getLastOrder();
-        if(time()-strtotime($order->created_at) > 1800){
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * 是否可以发送预警
-     * @param $channel
-     * @return bool
-     */
-    private function isCanAlert(){
-        $key = 'distribution_channel_id:orderalert';
-        $field = 'sendalert';
-        $res = Redis::hget($key,$field);
-        if($res && (time()-$res) < 1800 ){
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * 发送预警,并记录
-     * @param $channel_info
-     * @param $content
-     * @return bool
-     */
-    private function sendAndRecord($channel,$phone,$content){
-        if(empty($phone)){
-            return false;
-        }
-        $status = SMS::send($phone,$content);
-
-        $record = json_encode([
-            'phone'=>$phone,
-            'status'=>$status,
-            'time'=>time()
-        ]);
-        $key = 'distribution_channel_id:orderalert:record';
-        Redis::rpush($key,$record);
-    }
-}

+ 0 - 108
app/Console/Commands/IndividualOpPlatform/AddDeepReadRecords.php

@@ -1,108 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: tandunzhao
- * Date: 2017/11/20
- * Time: 下午5:26
- */
-
-namespace App\Console\Commands\IndividualOpPlatform;
-
-use DB;
-use Illuminate\Console\Command;
-use Log;
-use Redis;
-
-
-class AddDeepReadRecords extends Command
-{
-    /**
-     * 执行命令   php artisan force_user_active
-     *
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-    protected $signature = 'add_deep_read_records';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = '个性化运行平台添加';
-
-    /**
-     * Execute the console command.
-     *
-     * @return mixed
-     */
-    public function handle()
-    {
-        //章节订阅
-        for($i=0;$i<512;$i++) {
-            $res = DB::connection('chapter_order_read_mysql')
-                ->select("SELECT t.uid,t.bid,t.first_sub_time,(SELECT created_at FROM chapter_orders".$i." co1 WHERE co1.uid=t.uid
- AND co1.bid=t.bid
- AND (SELECT COUNT(*) FROM chapter_orders".$i." coo1
- WHERE coo1.uid=co1.uid AND co1.bid=coo1.bid AND coo1.id<=co1.id)=30) as deep_sub_time,'CHAPTER_ORDER' as 'charge_type',NOW() as 'created_at',NOW() as 'updated_at'
- FROM (SELECT * FROM (SELECT uid,bid,MIN(created_at) AS first_sub_time,count(id) as count FROM chapter_orders".$i." GROUP BY uid,bid HAVING count>=30) tmp
-					WHERE NOT EXISTS(SELECT 1 FROM deep_read_records WHERE deep_read_records.uid=tmp.uid AND deep_read_records.bid=tmp.bid)) t");
-            $to_insert = [];
-            foreach ($res as $item) {
-                $to_insert[] = array(
-                    'uid'=>$item->uid,
-                    'bid'=>$item->bid,
-                    'first_sub_time'=>$item->first_sub_time,
-                    'deep_sub_time'=>$item->deep_sub_time,
-                    'charge_type'=>$item->charge_type,
-                    'created_at'=>$item->created_at,
-                    'updated_at'=>$item->updated_at
-                );
-            }
-            //阅读记录插入订阅库
-            DB::connection('chapter_order_mysql')
-                ->table('deep_read_records')
-                ->insert($to_insert);
-            //阅读记录同步入主数据库
-            DB::table('deep_read_records')->insert($to_insert);
-        }
-        //单本订阅,无须筛选
-        /*$last_record_id = Redis::get('last_update_book_orders_id:');
-        $last_record_id = $last_record_id?intval($last_record_id):0;*/
-        //\Log::info('last_update_book_orders_id:'.$last_record_id);
-        //$current_max_id = $last_record_id;
-        /*DB::table("book_orders")
-            ->where('id','>',$last_record_id)
-            ->select(['id','uid','bid','created_at'])
-            ->groupBy('uid')
-            ->groupBy('bid')
-            ->orderBy('id')
-            ->chunk(1000,function ($res) use(&$current_max_id){
-                //$i=1;
-                $to_insert = [];
-                foreach ($res as $key=> $item){
-                    $to_insert[] = array(
-                        'uid'=>$item->uid,
-                        'bid'=>$item->bid,
-                        'first_sub_time'=>$item->created_at,
-                        'deep_sub_time'=>$item->created_at,
-                        'charge_type'=>'BOOK_ORDER',
-                        'created_at'=>date('Y-m-d H:i:s'),
-                        'updated_at'=>date('Y-m-d H:i:s')
-                    );
-                    if(($item->id)>$current_max_id){
-                        $current_max_id=$item->id;
-                    }
-                }
-                DB::table('deep_read_records')->insert($to_insert);
-            });*/
-        $sql = "INSERT INTO deep_read_records (`uid`,`bid`,`first_sub_time`,`deep_sub_time`,`charge_type`,`created_at`,`updated_at`) select `uid`, `bid`, `created_at` AS `first_sub_time`,`created_at`,'BOOK_ORDER',NOW(),NOW() AS `deep_sub_time`
- from `book_orders` WHERE uid>0 AND created_at >= '".date('Y-m-d',strtotime('-1 day'))."'
-  group by `uid`, `bid` ON DUPLICATE KEY UPDATE `updated_at` = (SELECT NOW())";
-        DB::update($sql);
-        //Redis::set('last_update_book_orders_id:',$current_max_id);
-    }
-}
-
-

+ 0 - 93
app/Console/Commands/Temp/CompanyNameFix.php

@@ -1,93 +0,0 @@
-<?php
-
-namespace App\Console\Commands\Temp;
-
-use App\Modules\MediaPush\Models\MediaPushBookConfigs;
-use App\Modules\MediaPush\Models\MediaPushRelationBooks;
-use Illuminate\Console\Command;
-use DB;
-
-class CompanyNameFix extends Command
-{
-    /**
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-    protected $signature = 'company_name_fix';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = '公司名修复';
-
-    /**
-     * Create a new command instance.
-     *
-     * @return void
-     */
-    public function __construct()
-    {
-        parent::__construct();
-    }
-
-    /**
-     * Execute the console command.
-     *
-     * @return mixed
-     */
-    public function handle()
-    {
-        $this->updateChannelUserInfo();
-        $this->updateChannelInfo();
-    }
-
-
-    /**
-     * 修复公司名字
-     */
-    public function updateChannelUserInfo()
-    {
-        //修复company_name,distribution_manages_id,person_in_charge_name字段
-        $users = DB::table('channel_users')->get();
-        foreach ($users as $user){
-            $company = DB::table('companies')->find($user->company_id);
-            if($company){
-                $distribution_manager = DB::table('distribution_manages')->find($company->distribution_manages_id);
-                $params =                     [
-                    "company_name"=>$company->name,
-                    "distribution_manages_id"=>$company->distribution_manages_id,
-                ];
-                if($distribution_manager)$params["person_in_charge_name"]=$distribution_manager->nickname;
-
-                $effect = DB::table('channel_users')->where('id',$user->id)->update($params);
-                if($effect)dump($user->id.'user改动');
-
-            }
-        }
-    }
-    /**
-     * 修复名字
-     */
-    public function updateChannelInfo()
-    {
-        //nickname,person_in_charge_name,distribution_manages_id字段
-        $distribution_channels = DB::table('distribution_channels')->get();
-        foreach ($distribution_channels as $channel){
-            $user = DB::table('channel_users')->find($channel->channel_user_id);
-            if($user){
-                $effect = DB::table('distribution_channels')->where('id',$channel->id)->update(
-                    [
-                        "nickname"=>$user->company_name,
-                        "distribution_manages_id"=>$user->distribution_manages_id,
-                        "person_in_charge_name"=>$user->person_in_charge_name,
-                    ]
-                );
-            }
-            if($effect)dump($channel->id.'channel改动');
-        }
-    }
-
-}

+ 0 - 66
app/Console/Commands/Tool/TestSmartPush.php

@@ -1,66 +0,0 @@
-<?php
-/**
-测试类
- */
-
-namespace App\Console\Commands\Tool;
-
-use Log;
-use Illuminate\Console\Command;
-use App\Modules\User\Services\UserService;
-
-use App\Modules\Book\Services\BookConfigService;
-
-use App\Modules\OfficialAccount\Services\ForceSubscribeService;
-use App\Modules\OfficialAccount\Services\OfficialAccountService;
-use App\Modules\User\Services\ReadRecordService;
-use DB;
-
-class TestSmartPush extends Command
-{
-    /**
-     * 执行命令   Tool:TestSmartPush
-     *
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-    protected $signature = 'Tool:TestSmartPush';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = '智能推送测试';
-
-    /**
-     * Execute the console command.
-     *
-     * @return mixed
-     */
-    public function handle()
-    {
-        ini_set('memory_limit', '1024M');
-        print_r('memory_used:'.memory_get_usage()."\n");
-        print_r("======智能推送测试【任务执行开始】=====".date("y-m-d H:i:s"."\n"));
-        $uid=6;
-//         $book_num=2;
-//         $bid=2;
-       
-// //         $recommend_books = BookConfigService::getSimpleChannelBookLoop($bid,$book_num,$uid);
-// //         \Log::info('$recommend_books');
-// //         \Log::info($recommend_books);
-        
-//         $distribution_channel_id = 14;
-//         $url = 'https://site2.yunqibook.com/reader?bid=2JWv0Xk1B3yqYRPxxWR6Gejno54PZrO9&cid=485877&fromsource=smart_push';
-        
-//         $result = OfficialAccountService::get_short_url($distribution_channel_id,$url);
-        
-        $result = ReadRecordService::getFirstReadRecord($uid);
-        \Log::info($result);
-        
-        print_r("======智能推送测试 【任务执行结束】=====".date("y-m-d H:i:s"."\n"));
-        print_r('memory_used:'.memory_get_usage()."\n");
-    }
-}

+ 0 - 19
app/Console/Commands/Tool/createTable.php

@@ -76,23 +76,4 @@ class createTable extends Command
         }
     }
 
-    private function createAdVisitTable(){
-        $next_month = date('Ym',strtotime('next Month'));
-        $sign_table = 'ad_visit_stats'.$next_month;
-        if (!Schema::hasTable($sign_table)) {
-            Schema::create($sign_table, function (Blueprint $table) {
-                $table->increments('id');
-                $table->integer('uid');
-                $table->integer('bid');
-                $table->integer('cid');
-                $table->char('type',10);
-                $table->dateTime('created_at');
-                $table->dateTime('updated_at');
-                $table->index(['uid','type'],'uid');
-                $table->index(['uid','cid','type'],'uid_cid');
-                $table->index('uid','o_uid');
-                $table->index(['type','created_at'],'type_date');
-            });
-        }
-    }
 }

+ 0 - 31
app/Console/Kernel.php

@@ -21,15 +21,12 @@ class Kernel extends ConsoleKernel
         Commands\BusinessChannelStatTask::class,
         Commands\BookAdjust::class,
         Commands\BookAdjustOne::class,
-        Commands\BookUpdate::class,
-        Commands\BookUpdateOne::class,
         Commands\UpdateBookClickCount::class,
         Commands\SignReward::class,
         Commands\NoPayRemind::class,
         Commands\Trade\GenerateOrderDayStat::class,
         Commands\Trade\GenerateOrderStat::class,
         Commands\SendServiceMsg::class,
-        Commands\FailOrderAlert::class,
         Commands\FailOrderAlertV2::class,
         Commands\BookAfterSpider::class,
         Commands\ChangePay::class,
@@ -62,7 +59,6 @@ class Kernel extends ConsoleKernel
         Commands\SmartPush\PaidUserCustom::class,
 
         Commands\Tool\OfficialAccountUserTranser::class,
-        Commands\Tool\TestSmartPush::class,
         Commands\Tool\MaintainTempForceSubscribeUser::class,
         Commands\Tool\MaintainUserSign::class,
         Commands\Tool\TitleImageStatistics::class,
@@ -81,14 +77,10 @@ class Kernel extends ConsoleKernel
         Commands\CheckOfficialAccountTemplate::class,
         Commands\OfficialAccountStat\SubUserRecharge::class,
         Commands\WapVisitStat::class,
-        Commands\CP\GenerateCpBookStat::class,
-        Commands\CP\fixCpBookStat::class,
-        Commands\CP\GenerateCpBookBetweenStat::class,
         Commands\AutoSendTrusteeShipCustomerMsg::class,
         Commands\CustomMsg\CustomMsgStrategyAutoSend::class,
         Commands\BookAttr::class,
         Commands\OfficialAccountBillsTask::class,
-        Commands\Temp\CompanyNameFix::class,
 
         Commands\SendOrder\SendStatsEmail::class,
         Commands\ProductStats\SendMonthStatsEmail::class,
@@ -102,7 +94,6 @@ class Kernel extends ConsoleKernel
         Commands\SuperiorBooks\HistorySupriorBook::class,
 
         Commands\UserSubscribleStatistic::class,
-        Commands\CheckBookCover::class,
         Commands\fansMaximumNotice::class,
         Commands\BookGiftStats\BookGiftStatsByBook::class,
         Commands\BookGiftStats\BookGiftStatsByGift::class,
@@ -121,7 +112,6 @@ class Kernel extends ConsoleKernel
 
         Commands\SmartPush\UpdateMediaPushRechargeInfo::class,
         Commands\SmartPush\UpdateRecommandBooks::class,
-        Commands\IndividualOpPlatform\AddDeepReadRecords::class,
         Commands\ZsyAlert::class,
 
         Commands\ActiveUser::class,
@@ -130,7 +120,6 @@ class Kernel extends ConsoleKernel
         Commands\SendOrder\GenerateDayByBooksStat::class,
 
         Commands\OfficialAccountStat\OfficialAccountForbiddenStatus::class,
-        Commands\CpcAdvertise\CpcBillTasks::class,
         Commands\LatestCustomerMsg::class,
         Commands\BookSearchInfoStat::class,
 
@@ -138,7 +127,6 @@ class Kernel extends ConsoleKernel
 
         Commands\SuperiorBooks\UpdateHighQualityBooks::class,
         Commands\userProperty::class,
-        Commands\UserMonthOrderDayStats::class,
         Commands\Channel\SiteTitle::class,
 
         Commands\SendOrder\UpdateSendOrderPreSendDate::class, //派单预计发送时间
@@ -169,9 +157,6 @@ class Kernel extends ConsoleKernel
         //bookChargeStats 图书充值统计
         Commands\Book\bookChargeStats::class,
 
-        //自动下架与提醒
-        Commands\Book\BookAutoOffShelf::class,
-
     ];
 
     /**
@@ -255,15 +240,6 @@ class Kernel extends ConsoleKernel
         //uv pv redis持久
         $schedule->command('wvs 9')->dailyAt('04:00');
 
-        //  cp书籍订阅数据,需在order_day_stats后执行,改为每天执行一次
-        $schedule->command('cp_generate_cp_book_stat')->dailyAt('05:10');
-
-        // 自动提现申请
-//         $schedule->command('AutoWithdrawCash')->dailyAt('01:20');
-
-        //自动推送托管客服消息
-//         $schedule->command('AutoSendTrusteeShipCustomerMsg')->hourlyAt(2);
-
         //客服消息策略发送客服消息
         $schedule->command('auth_send_custom_msg_by_strategy')->hourlyAt(4);
 
@@ -329,8 +305,6 @@ class Kernel extends ConsoleKernel
         $schedule->command('MaintainTempForceSubscribeUser')->dailyAt('03:02');
         //签到中间表每日维护
         $schedule->command('MaintainUserSign')->dailyAt('03:04');
-
-        $schedule->command('check_book_cover_status')->weekly()->mondays()->at('04:10');
         //阈值提醒
         $schedule->command('addFansMaximumNotice')->hourly();
 
@@ -356,8 +330,6 @@ class Kernel extends ConsoleKernel
         //完整 阅读记录
         $schedule->command('ReadRecordPersistence')->everyFiveMinutes();
 
-        //网站预警
-//         $schedule->command('zsyalert')->everyMinute();
 
 
         //注册用户地区信息统计
@@ -424,9 +396,6 @@ class Kernel extends ConsoleKernel
         $schedule->command('cp_agent_day_stat')->dailyAt('01:44');
         $schedule->command('new_user_charge_day_statistic')->dailyAt('05:44');
 
-        //自动下架与提醒
-        $schedule->command('Book:BookAutoOffShelf')->dailyAt('09:53');
-
 
     }
 }