<commit_before><?php

namespace App\Console\Commands;

use App\Models\SysCrontab;
use Illuminate\Console\Command;
use App\Models\Busi\Attendance;
use DB;
use JPush\Client as JPush;
use App\Services\LogSvr;
use App\Models\Busi\MessageTemplate;
use App\Models\Busi\WorkCalendarData;

class AttendancePolling extends Command
{
	protected $name = 'attendance_polling';
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:attendance_polling';

    /**
     * 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()
    {
        //
	    LogSvr::AttendancPolling()->info('考勤日完成情况轮询通知开始..!');
        $today = date('Y-m-d');
        $day = WorkCalendarData::where('fday', $today)->first();
        if(!$day->fis_work_time) return; //非工作日

        $sql = <<<EOH
select e.id from bd_employees e
where NOT EXISTS (select a.id from ms_attendances a where e.id = a.femp_id and DATE_FORMAT(a.ftime,'%Y-%m-%d')='$today' and a.ftype = 1)
EOH;<commit_msg>bug fix<commit_after><?php

namespace App\Console\Commands;

use App\Models\SysCrontab;
use Illuminate\Console\Command;
use App\Models\Busi\Attendance;
use DB;
use JPush\Client as JPush;
use App\Services\LogSvr;
use App\Models\Busi\MessageTemplate;
use App\Models\Busi\WorkCalendarData;

class AttendancePolling extends Command
{
	protected $name = 'attendance_polling';
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:attendance_polling';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '考勤日完成情况轮询通知';

	/**
	 * Create a new command instance.
	 *
	 */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        //
	    LogSvr::AttendancPolling()->info('考勤日完成情况轮询通知开始..!');
        $today = date('Y-m-d');
        $day = WorkCalendarData::where('fday', $today)->first();
        if(!$day->fis_work_time) return; //非工作日

        $sql = <<<EOH
select e.id from bd_employees e
where NOT EXISTS (select a.id from ms_attendances a where e.id = a.femp_id and DATE_FORMAT(a.ftime,'%Y-%m-%d')='$today' and a.ftype = 1)
EOH;
{'fraction_non_alphanumeric': 0.1351963746223565, 'fraction_numerical': 0.0007552870090634441, 'mean_word_length': 2.6791666666666667, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2261233', 'n_tokens_mistral': 934, 'n_tokens_neox': 925, 'n_words': 204}