gpt4 book ai didi

php - Yii2:mysql 查询以获取有关待处理作业的提醒?

转载 作者:行者123 更新时间:2023-11-28 23:56:20 24 4
gpt4 key购买 nike

尝试执行查询以获取当前状态不等于 PACKING 或 DISPATCH 的 job_code、job_description、client_code 在其截止日期前 2 天之前-

$query = new Query;
$todo = (new yii\db\Query())
->SELECT(['status','job_code','job_description','client_code'])
->from('create_job')
->where('status' LIKE 'PACKING' OR 'DISPATCH' AND 'approved_date' >= 'CURRENT_DATE' AND 'deadline' < 'CURRENT_DATE' + 'INTERVAL 2 DAY')
->all();

如何实现?

最佳答案

试试这个

(new Query())->select(['status','job_code','job_description','client_code'])
->from('create_job')
->andWhere("status != 'PACKING'")
->andWhere("status != 'DISPATCH'")
->andWhere('deadline < (CURRENT_DATE + INTERVAL 2 DAY)')
->all();

关于php - Yii2:mysql 查询以获取有关待处理作业的提醒?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31578501/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com