Files
Smart-Farm/app/Common/model/LongbingCardFromId.php
2025-12-22 14:32:54 +08:00

39 lines
859 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace app\Common\model;
use app\BaseModel;
class LongbingCardFromId extends BaseModel
{
//定义表名称
protected $name = 'longbing_card_form_id';
//获取Fromid
public function getFromId($filter)
{
$result = $this->where($filter)->order('id asc')->find();
if(!empty($result)) $result = $result->toArray();
return $result;
}
//删除7天前的fromid
public function autoDelFromId()
{
$filter = [['create_time' ,'<' ,mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - 6, date( 'Y' ) )]];
$result = $this->delFromId($filter);
return !empty($result);
}
//删除id
public function delFromId($filter)
{
$result = $this->destoryFromId($filter);
return !empty($result);
}
//删除fromId真删除
public function destoryFromId($filter)
{
$result = $this->where($filter)->delete();
return !empty($result);
}
}