Skip to content

Commit

Permalink
修正PHP版本兼容性问题
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Aug 9, 2019
1 parent d867ebe commit b538d26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions library/think/model/relation/HasManyThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public function hasWhere($where = [], $fields = null)
->alias($model)
->join($throughTable, $throughTable . '.' . $this->foreignKey . '=' . $model . '.' . $this->localKey)
->join($modelTable, $modelTable . '.' . $throughKey . '=' . $throughTable . '.' . $this->throughPk)
->when($softDelete, function ($query) use ($softDelete, $relationTable) {
$query->where($relationTable . strstr($softDelete[0], '.'), '=' == $softDelete[1][0] ? $softDelete[1][1] : null);
->when($softDelete, function ($query) use ($softDelete, $modelTable) {
$query->where($modelTable . strstr($softDelete[0], '.'), '=' == $softDelete[1][0] ? $softDelete[1][1] : null);
})
->group($modelTable . '.' . $this->throughKey)
->where($where)
Expand All @@ -147,7 +147,7 @@ public function hasWhere($where = [], $fields = null)
* @param Closure $closure 闭包
* @return void
*/
public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation = [], Closure $closure = null): void
public function eagerlyResultSet(array &$resultSet, $relation, array $subRelation = [], $closure = null)
{
$localKey = $this->localKey;
$foreignKey = $this->foreignKey;
Expand Down Expand Up @@ -196,7 +196,7 @@ public function eagerlyResultSet(array &$resultSet, string $relation, array $sub
* @param Closure $closure 闭包
* @return void
*/
public function eagerlyResult(Model $result, string $relation, array $subRelation = [], Closure $closure = null): void
public function eagerlyResult($result, $relation, array $subRelation = [], $closure = null)
{
$localKey = $this->localKey;
$foreignKey = $this->foreignKey;
Expand Down Expand Up @@ -230,7 +230,7 @@ public function eagerlyResult(Model $result, string $relation, array $subRelatio
* @param Closure $closure
* @return array
*/
protected function eagerlyWhere(array $where, string $key, string $relation, array $subRelation = [], Closure $closure = null)
protected function eagerlyWhere(array $where, $key, $relation, array $subRelation = [], $closure = null)
{
// 预载入关联查询 支持嵌套预载入
$throughList = $this->through->where($where)->select();
Expand Down Expand Up @@ -263,7 +263,7 @@ protected function eagerlyWhere(array $where, string $key, string $relation, arr
* @param string $name 统计字段别名
* @return integer
*/
public function relationCount(Model $result, Closure $closure, string $aggregate = 'count', string $field = '*', string &$name = null)
public function relationCount($result, $closure, $aggregate = 'count', $field = '*', &$name = null)
{
$localKey = $this->localKey;

Expand Down Expand Up @@ -305,7 +305,7 @@ public function relationCount(Model $result, Closure $closure, string $aggregate
* @param string $name 统计字段别名
* @return string
*/
public function getRelationCountQuery(Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null): string
public function getRelationCountQuery($closure = null, $aggregate = 'count', $field = '*', &$name = null)
{
if ($closure) {
$return = $closure($this->query);
Expand Down
2 changes: 1 addition & 1 deletion library/think/response/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function output($data)
* @param bool $content
* @return $this
*/
public function isContent(bool $content = true)
public function isContent($content = true)
{
$this->isContent = $content;
return $this;
Expand Down

0 comments on commit b538d26

Please sign in to comment.