framework icon indicating copy to clipboard operation
framework copied to clipboard

ThinkPHP Framework

Results 260 framework issues
Sort by recently updated
recently updated
newest added

A模型中设置 public function b() { return $this->hasMany(B::class,'id','id'); } 随后在控制器中进行查询 A->with(['b'=>function($query){ $query->order('a','desc'); }])->find(); 这时候根据日志,会报错,SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'order clause' 但是这里B数据表中是肯定有id字段的。

Db::execute 无法选择库: 数据库配置未定义mysql 无法在存在多库时使用原生execute

![image](https://user-images.githubusercontent.com/31383501/164387438-9febb831-df9c-4989-b681-3e87c3046fb7.png) 如果不更新 thinkphp 版本(如果更新,项目要改的东西比较多),请问有其他解决的办法吗?

![image](https://user-images.githubusercontent.com/45870098/163710236-595fd5e3-c04c-470e-bc1d-2b9c8156e437.png) ![image](https://user-images.githubusercontent.com/45870098/163710255-c4331d60-dddf-462f-8e16-1144a50e8573.png) ![image](https://user-images.githubusercontent.com/45870098/163710287-59682259-fed6-4599-932e-a6d72bd08286.png)

```php $valdiate = Validate::check([ 'user_phone' => '136***142' ],[ 'user_phone' => 'unique:app\model\User,,1,' ]); // SELECT `user_guid` FROM `user` WHERE ( = '136***142' AND `user_guid` '1' ) AND `user`.`user_delete_time` IS NULL LIMIT...

``` // 执行HTTP应用并响应 $http = (new App())->http; $response = $http->run(); // 一下两个步骤中如果出现错误,则不会产生错误日志。 $response->send(); $http->end($response); ```

之前的问题,想要临时切换引擎必须用下面的写法: ``` View::engine('php'); View::assign('test','test'); View::config([ 'view_suffix'=>'php' ]); return View::fetch(); ``` 以下写法有问题,下面的方法既无法修改配置,也无法传递test变量: ``` View::assign('test','test'); View::config([ 'view_suffix'=>'phps' ]); return View::engine('php')->fetch(); ```