first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\common\model\finance;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\facade\Db;
|
||||
|
||||
class AccountCost extends BaseModel
|
||||
{
|
||||
protected $name = 'account_cost';
|
||||
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
protected $createTime = 'create_time';
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\common\model\finance;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
class DeptPerformanceTarget extends BaseModel
|
||||
{
|
||||
protected $name = 'dept_performance_target';
|
||||
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
protected $createTime = 'create_time';
|
||||
|
||||
protected $updateTime = 'update_time';
|
||||
}
|
||||
Reference in New Issue
Block a user