This commit is contained in:
Your Name
2026-04-27 15:30:48 +08:00
10 changed files with 457 additions and 43 deletions
@@ -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;
}
}