Merge branch 'master' of https://gitee.com/v_cms/zyt
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace app\common\model\finance;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\facade\Db;
|
||||
|
||||
class AccountCost extends BaseModel
|
||||
{
|
||||
@@ -17,4 +18,23 @@ class AccountCost extends BaseModel
|
||||
protected $updateTime = 'update_time';
|
||||
|
||||
protected $dateFormat = 'Y-m-d H:i:s';
|
||||
|
||||
public static function supportsDeptBinding(): bool
|
||||
{
|
||||
static $supported = null;
|
||||
if ($supported !== null) {
|
||||
return $supported;
|
||||
}
|
||||
|
||||
try {
|
||||
$fields = Db::name('account_cost')->getTableFields();
|
||||
$supported = is_array($fields)
|
||||
&& in_array('dept_id', $fields, true)
|
||||
&& in_array('dept_name', $fields, true);
|
||||
} catch (\Throwable) {
|
||||
$supported = false;
|
||||
}
|
||||
|
||||
return $supported;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user