FundsRecord.php 878 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Models;
  3. // // 关键:导入正确的 Builder 类(Eloquent 构建器)
  4. // use Illuminate\Database\Eloquent\Builder;
  5. class FundsRecord extends BaseModel
  6. {
  7. protected $table = 'balance_logs';
  8. protected $fillable = ['id', 'room_id', 'member_id' ,'amount' ,'before_balance' ,'after_balance' ,'change_type','created_at','remark'];
  9. // public function newQuery($excludeDeleted = true): Builder
  10. // {
  11. // // 1. 获取原生 Eloquent 查询构建器
  12. // $query = parent::newQuery($excludeDeleted);
  13. // // 2. 强制清空当前连接的表前缀(从根源阻止拼接)
  14. // $this->getConnection()->setTablePrefix('');
  15. // // 3. 强制指定查询的表名为 la_operation(覆盖所有拼接逻辑)
  16. // $query->from('bot_balance_logs');
  17. // return $query;
  18. // }
  19. }