去除安装时数据库版本判断

This commit is contained in:
hdm 2023-02-22 17:50:05 +08:00
parent 72d294aa11
commit 81239d8950
2 changed files with 17 additions and 20 deletions

View File

@ -27,23 +27,23 @@ class Expense extends Model
});
}
else{
$expense = Expense::where($where)
->order('id desc')
->paginate($rows, false, ['query' => $param])
->each(function ($item, $key) {
$item->income_month = empty($item->income_month) ? '-' : date('Y-m', $item->income_month);
$item->expense_time = empty($item->expense_time) ? '-' : date('Y-m-d', $item->expense_time);
$item->admin_name = Db::name('Admin')->where(['id' => $item->admin_id])->value('name');
$item->department = Db::name('Department')->where(['id' => $item->did])->value('title');
$item->pay_name = Db::name('Admin')->where(['id' => $item->pay_admin_id])->value('name');
$item->pay_time = empty($item->pay_time) ? '-' : date('Y-m-d H:i', $item->pay_time);
$item->amount = Db::name('ExpenseInterfix')->where(['exid' => $item->id])->sum('amount');
$item['check_user'] = '-';
if($item['check_status']==1 && !empty($item['check_admin_ids'])){
$check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name');
$item['check_user'] = implode(',',$check_user);
}
});
$expense = Expense::where($where)
->order('id desc')
->paginate($rows, false, ['query' => $param])
->each(function ($item, $key) {
$item->income_month = empty($item->income_month) ? '-' : date('Y-m', $item->income_month);
$item->expense_time = empty($item->expense_time) ? '-' : date('Y-m-d', $item->expense_time);
$item->admin_name = Db::name('Admin')->where(['id' => $item->admin_id])->value('name');
$item->department = Db::name('Department')->where(['id' => $item->did])->value('title');
$item->pay_name = Db::name('Admin')->where(['id' => $item->pay_admin_id])->value('name');
$item->pay_time = empty($item->pay_time) ? '-' : date('Y-m-d H:i', $item->pay_time);
$item->amount = Db::name('ExpenseInterfix')->where(['exid' => $item->id])->sum('amount');
$item['check_user'] = '-';
if($item['check_status']==1 && !empty($item['check_admin_ids'])){
$check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name');
$item['check_user'] = implode(',',$check_user);
}
});
}
return $expense;
}

View File

@ -98,9 +98,6 @@ class Index
}
// 设置字符集
$link->query("SET NAMES 'utf8mb4'");
if ($link->server_info < 5.0) {
return to_assign(1, '请将您的mysql升级到5.0以上');die;
}
//验证表是否存在
try {
// 这里是主体代码