Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
c3b584d5
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c3b584d5
编写于
7月 19, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
框架更新
上级
6c215fcb
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
228 addition
and
65 deletion
+228
-65
composer.lock
composer.lock
+133
-25
extend/base/Excel.php
extend/base/Excel.php
+1
-1
vendor/composer/installed.json
vendor/composer/installed.json
+14
-8
vendor/composer/installed.php
vendor/composer/installed.php
+16
-16
vendor/services.php
vendor/services.php
+1
-1
vendor/topthink/think-orm/src/Paginator.php
vendor/topthink/think-orm/src/Paginator.php
+1
-1
vendor/topthink/think-orm/src/db/BaseQuery.php
vendor/topthink/think-orm/src/db/BaseQuery.php
+2
-2
vendor/topthink/think-orm/src/db/concern/ResultOperation.php
vendor/topthink/think-orm/src/db/concern/ResultOperation.php
+4
-4
vendor/topthink/think-orm/src/model/Relation.php
vendor/topthink/think-orm/src/model/Relation.php
+18
-0
vendor/topthink/think-orm/src/model/concern/Attribute.php
vendor/topthink/think-orm/src/model/concern/Attribute.php
+3
-1
vendor/topthink/think-orm/src/model/concern/ModelEvent.php
vendor/topthink/think-orm/src/model/concern/ModelEvent.php
+1
-1
vendor/topthink/think-orm/src/model/concern/SoftDelete.php
vendor/topthink/think-orm/src/model/concern/SoftDelete.php
+10
-2
vendor/topthink/think-orm/src/model/relation/BelongsToMany.php
...r/topthink/think-orm/src/model/relation/BelongsToMany.php
+6
-1
vendor/topthink/think-orm/src/model/relation/HasMany.php
vendor/topthink/think-orm/src/model/relation/HasMany.php
+4
-0
vendor/topthink/think-orm/src/model/relation/HasManyThrough.php
.../topthink/think-orm/src/model/relation/HasManyThrough.php
+6
-1
vendor/topthink/think-orm/src/model/relation/MorphToMany.php
vendor/topthink/think-orm/src/model/relation/MorphToMany.php
+6
-1
vendor/topthink/think-orm/src/model/relation/OneToOne.php
vendor/topthink/think-orm/src/model/relation/OneToOne.php
+2
-0
未找到文件。
composer.lock
浏览文件 @
c3b584d5
...
...
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "
af4c1d3fa817eb8c58caa9a7ec0362b0
",
"content-hash": "
d9dceec7f610e50f6c7498e698d42d38
",
"packages": [
{
"name": "league/flysystem",
...
...
@@ -18,7 +18,13 @@
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32",
"reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-fileinfo": "*",
...
...
@@ -112,7 +118,13 @@
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff",
"reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"league/flysystem": "~1.0",
...
...
@@ -163,7 +175,13 @@
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3",
"reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-fileinfo": "*",
...
...
@@ -219,7 +237,13 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.0"
...
...
@@ -268,7 +292,13 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.2.0"
...
...
@@ -316,7 +346,13 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.0"
...
...
@@ -366,7 +402,13 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.0"
...
...
@@ -417,7 +459,13 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/4789343672aef06d571d556da369c0e156609bce",
"reference": "4789343672aef06d571d556da369c0e156609bce",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-json": "*",
...
...
@@ -482,7 +530,13 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-helper/zipball/f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905",
"reference": "f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.1.0"
...
...
@@ -525,7 +579,13 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-multi-app/zipball/ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3",
"reference": "ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.1.0",
...
...
@@ -563,17 +623,23 @@
},
{
"name": "topthink/think-orm",
"version": "v2.0.4
0
",
"version": "v2.0.4
1
",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-orm.git",
"reference": "
1119d979b850849f3725856460cf108eec1c3eb8
"
"reference": "
64bbfdde01f4fd6939c2f695fceb08e6d764ac6b
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-orm/zipball/1119d979b850849f3725856460cf108eec1c3eb8",
"reference": "1119d979b850849f3725856460cf108eec1c3eb8",
"shasum": ""
"url": "https://api.github.com/repos/top-think/think-orm/zipball/64bbfdde01f4fd6939c2f695fceb08e6d764ac6b",
"reference": "64bbfdde01f4fd6939c2f695fceb08e6d764ac6b",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-json": "*",
...
...
@@ -612,9 +678,9 @@
],
"support": {
"issues": "https://github.com/top-think/think-orm/issues",
"source": "https://github.com/top-think/think-orm/tree/v2.0.4
0
"
"source": "https://github.com/top-think/think-orm/tree/v2.0.4
1
"
},
"time": "2021-0
4-19T13:29:37
+00:00"
"time": "2021-0
7-14T07:51:15
+00:00"
},
{
"name": "topthink/think-template",
...
...
@@ -628,7 +694,13 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-template/zipball/abfc293f74f9ef5127b5c416310a01fe42e59368",
"reference": "abfc293f74f9ef5127b5c416310a01fe42e59368",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.1.0",
...
...
@@ -669,7 +741,13 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-view/zipball/edce0ae2c9551ab65f9e94a222604b0dead3576d",
"reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.1.0",
...
...
@@ -712,7 +790,13 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1",
"reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.1"
...
...
@@ -792,7 +876,13 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976",
"reference": "9a142215a36a3888e30d0a9eeea9766764e96976",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.1"
...
...
@@ -868,7 +958,13 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0",
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.1"
...
...
@@ -951,7 +1047,13 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/a586efdf2aa832d05b9249e9115d24f6a2691160",
"reference": "a586efdf2aa832d05b9249e9115d24f6a2691160",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.1.3",
...
...
@@ -1040,7 +1142,13 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-trace/zipball/9a9fa8f767b6c66c5a133ad21ca1bc96ad329444",
"reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444",
"shasum": ""
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.1.0",
...
...
extend/base/Excel.php
浏览文件 @
c3b584d5
...
...
@@ -210,7 +210,7 @@ class Excel
header
(
'Expires: 0'
);
header
(
'Cache-Control:must-revalidate, post-check=0, pre-check=0'
);
header
(
'Content-Type:application/force-download'
);
header
(
'Content-Type: application/'
.
$this
->
file_type
.
';
;
charset='
.
$charset
);
header
(
'Content-Type: application/'
.
$this
->
file_type
.
';charset='
.
$charset
);
header
(
'Content-Type:application/octet-stream'
);
header
(
'Content-Type:application/download'
);
header
(
'Content-Disposition:attachment;filename='
.
$this
->
filename
.
'.'
.
$this
->
suffix
);
...
...
vendor/composer/installed.json
浏览文件 @
c3b584d5
...
...
@@ -927,18 +927,24 @@
},
{
"name"
:
"topthink/think-orm"
,
"version"
:
"v2.0.4
0
"
,
"version_normalized"
:
"2.0.4
0
.0"
,
"version"
:
"v2.0.4
1
"
,
"version_normalized"
:
"2.0.4
1
.0"
,
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/top-think/think-orm.git"
,
"reference"
:
"
1119d979b850849f3725856460cf108eec1c3eb8
"
"reference"
:
"
64bbfdde01f4fd6939c2f695fceb08e6d764ac6b
"
},
"dist"
:
{
"type"
:
"zip"
,
"url"
:
"https://api.github.com/repos/top-think/think-orm/zipball/1119d979b850849f3725856460cf108eec1c3eb8"
,
"reference"
:
"1119d979b850849f3725856460cf108eec1c3eb8"
,
"shasum"
:
""
"url"
:
"https://api.github.com/repos/top-think/think-orm/zipball/64bbfdde01f4fd6939c2f695fceb08e6d764ac6b"
,
"reference"
:
"64bbfdde01f4fd6939c2f695fceb08e6d764ac6b"
,
"shasum"
:
""
,
"mirrors"
:
[
{
"url"
:
"https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%"
,
"preferred"
:
true
}
]
},
"require"
:
{
"ext-json"
:
"*"
,
...
...
@@ -951,7 +957,7 @@
"require-dev"
:
{
"phpunit/phpunit"
:
"^7|^8|^9.5"
},
"time"
:
"2021-0
4-19T13:29:37
+00:00"
,
"time"
:
"2021-0
7-14T07:51:15
+00:00"
,
"type"
:
"library"
,
"installation-source"
:
"dist"
,
"autoload"
:
{
...
...
@@ -979,7 +985,7 @@
],
"support"
:
{
"issues"
:
"https://github.com/top-think/think-orm/issues"
,
"source"
:
"https://github.com/top-think/think-orm/tree/v2.0.4
0
"
"source"
:
"https://github.com/top-think/think-orm/tree/v2.0.4
1
"
},
"install-path"
:
"../topthink/think-orm"
},
...
...
vendor/composer/installed.php
浏览文件 @
c3b584d5
<?php
return
array
(
'root'
=>
array
(
'pretty_version'
=>
'
1.0.0+no-version-set
'
,
'version'
=>
'
1.0.0.0
'
,
'pretty_version'
=>
'
dev-master
'
,
'version'
=>
'
dev-master
'
,
'type'
=>
'project'
,
'install_path'
=>
__DIR__
.
'/../../'
,
'aliases'
=>
array
(),
'reference'
=>
NULL
,
'name'
=>
'
topthink/think
'
,
'reference'
=>
'6c215fcba72e60dc4017bd65b0bc08b8b67c94d2'
,
'name'
=>
'
shopxo/shopxo
'
,
'dev'
=>
true
,
),
'versions'
=>
array
(
...
...
@@ -73,6 +73,15 @@
'reference'
=>
'408d5eafb83c57f6365a3ca330ff23aa4a5fa39b'
,
'dev_requirement'
=>
false
,
),
'shopxo/shopxo'
=>
array
(
'pretty_version'
=>
'dev-master'
,
'version'
=>
'dev-master'
,
'type'
=>
'project'
,
'install_path'
=>
__DIR__
.
'/../../'
,
'aliases'
=>
array
(),
'reference'
=>
'6c215fcba72e60dc4017bd65b0bc08b8b67c94d2'
,
'dev_requirement'
=>
false
,
),
'symfony/polyfill-mbstring'
=>
array
(
'pretty_version'
=>
'v1.23.0'
,
'version'
=>
'1.23.0.0'
,
...
...
@@ -118,15 +127,6 @@
'reference'
=>
'4789343672aef06d571d556da369c0e156609bce'
,
'dev_requirement'
=>
false
,
),
'topthink/think'
=>
array
(
'pretty_version'
=>
'1.0.0+no-version-set'
,
'version'
=>
'1.0.0.0'
,
'type'
=>
'project'
,
'install_path'
=>
__DIR__
.
'/../../'
,
'aliases'
=>
array
(),
'reference'
=>
NULL
,
'dev_requirement'
=>
false
,
),
'topthink/think-helper'
=>
array
(
'pretty_version'
=>
'v3.1.5'
,
'version'
=>
'3.1.5.0'
,
...
...
@@ -146,12 +146,12 @@
'dev_requirement'
=>
false
,
),
'topthink/think-orm'
=>
array
(
'pretty_version'
=>
'v2.0.4
0
'
,
'version'
=>
'2.0.4
0
.0'
,
'pretty_version'
=>
'v2.0.4
1
'
,
'version'
=>
'2.0.4
1
.0'
,
'type'
=>
'library'
,
'install_path'
=>
__DIR__
.
'/../topthink/think-orm'
,
'aliases'
=>
array
(),
'reference'
=>
'
1119d979b850849f3725856460cf108eec1c3eb8
'
,
'reference'
=>
'
64bbfdde01f4fd6939c2f695fceb08e6d764ac6b
'
,
'dev_requirement'
=>
false
,
),
'topthink/think-template'
=>
array
(
...
...
vendor/services.php
浏览文件 @
c3b584d5
<?php
// This file is automatically generated at:2021-07-1
4 19:19:06
// This file is automatically generated at:2021-07-1
9 11:36:48
declare
(
strict_types
=
1
);
return
array
(
0
=>
'think\\app\\Service'
,
...
...
vendor/topthink/think-orm/src/Paginator.php
浏览文件 @
c3b584d5
...
...
@@ -175,7 +175,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
$path
=
$this
->
options
[
'path'
];
}
else
{
$parameters
=
[];
$path
=
str_replace
(
'[PAGE]'
,
$page
,
$this
->
options
[
'path'
]);
$path
=
str_replace
(
'[PAGE]'
,
(
string
)
$page
,
$this
->
options
[
'path'
]);
}
if
(
count
(
$this
->
options
[
'query'
])
>
0
)
{
...
...
vendor/topthink/think-orm/src/db/BaseQuery.php
浏览文件 @
c3b584d5
...
...
@@ -1075,7 +1075,7 @@ abstract class BaseQuery
* 查找记录
* @access public
* @param mixed $data 数据
* @return Collection
* @return Collection
|array|static[]
* @throws Exception
* @throws ModelNotFoundException
* @throws DataNotFoundException
...
...
@@ -1109,7 +1109,7 @@ abstract class BaseQuery
* 查找单条记录
* @access public
* @param mixed $data 查询数据
* @return array|Model|null
* @return array|Model|null
|static
* @throws Exception
* @throws ModelNotFoundException
* @throws DataNotFoundException
...
...
vendor/topthink/think-orm/src/db/concern/ResultOperation.php
浏览文件 @
c3b584d5
...
...
@@ -149,7 +149,7 @@ trait ResultOperation
/**
* 处理空数据
* @access protected
* @return array|Model|null
* @return array|Model|null
|static
* @throws DbException
* @throws ModelNotFoundException
* @throws DataNotFoundException
...
...
@@ -167,7 +167,7 @@ trait ResultOperation
* 查找单条记录 不存在返回空数据(或者空模型)
* @access public
* @param mixed $data 数据
* @return array|Model
* @return array|Model
|static
*/
public
function
findOrEmpty
(
$data
=
null
)
{
...
...
@@ -226,7 +226,7 @@ trait ResultOperation
* 查找多条记录 如果不存在则抛出异常
* @access public
* @param array|string|Query|Closure $data 数据
* @return array|
Model
* @return array|
Collection|static[]
*/
public
function
selectOrFail
(
$data
=
null
)
{
...
...
@@ -237,7 +237,7 @@ trait ResultOperation
* 查找单条记录 如果不存在则抛出异常
* @access public
* @param array|string|Query|Closure $data 数据
* @return array|Model
* @return array|Model
|static
*/
public
function
findOrFail
(
$data
=
null
)
{
...
...
vendor/topthink/think-orm/src/model/Relation.php
浏览文件 @
c3b584d5
...
...
@@ -79,6 +79,12 @@ abstract class Relation
*/
protected
$withField
;
/**
* 排除关联数据字段
* @var array
*/
protected
$withoutField
;
/**
* 获取关联的所属模型
* @access public
...
...
@@ -236,6 +242,18 @@ abstract class Relation
return
$this
;
}
/**
* 排除关联数据的字段
* @access public
* @param array $field 关联字段限制
* @return $this
*/
public
function
withoutField
(
array
$field
)
{
$this
->
withoutField
=
$field
;
return
$this
;
}
/**
* 判断闭包的参数类型
* @access protected
...
...
vendor/topthink/think-orm/src/model/concern/Attribute.php
浏览文件 @
c3b584d5
...
...
@@ -496,7 +496,9 @@ trait Attribute
$value
=
$this
->
getJsonValue
(
$fieldName
,
$value
);
}
else
{
$closure
=
$this
->
withAttr
[
$fieldName
];
$value
=
$closure
(
$value
,
$this
->
data
);
if
(
$closure
instanceof
\
Closure
)
{
$value
=
$closure
(
$value
,
$this
->
data
);
}
}
}
elseif
(
method_exists
(
$this
,
$method
))
{
if
(
$relation
)
{
...
...
vendor/topthink/think-orm/src/model/concern/ModelEvent.php
浏览文件 @
c3b584d5
...
...
@@ -74,7 +74,7 @@ trait ModelEvent
if
(
method_exists
(
static
::
class
,
$call
))
{
$result
=
call_user_func
([
static
::
class
,
$call
],
$this
);
}
elseif
(
is_object
(
self
::
$event
)
&&
method_exists
(
self
::
$event
,
'trigger'
))
{
$result
=
self
::
$event
->
trigger
(
static
::
class
.
'.'
.
$event
,
$this
);
$result
=
self
::
$event
->
trigger
(
'model.'
.
static
::
class
.
'.'
.
$event
,
$this
);
$result
=
empty
(
$result
)
?
true
:
end
(
$result
);
}
else
{
$result
=
true
;
...
...
vendor/topthink/think-orm/src/model/concern/SoftDelete.php
浏览文件 @
c3b584d5
...
...
@@ -151,8 +151,16 @@ trait SoftDelete
*/
public
static
function
destroy
(
$data
,
bool
$force
=
false
):
bool
{
// 包含软删除数据
$query
=
(
new
static
())
->
withTrashedData
(
true
)
->
db
(
false
);
// 传入空值(包括空字符串和空数组)的时候不会做任何的数据删除操作,但传入0则是有效的
if
(
empty
(
$data
)
&&
$data
!==
0
){
return
false
;
}
// 仅当强制删除时包含软删除数据
$model
=
(
new
static
());
if
(
$force
){
$model
->
withTrashedData
(
true
);
}
$query
=
$model
->
db
(
false
);
if
(
is_array
(
$data
)
&&
key
(
$data
)
!==
0
)
{
$query
->
where
(
$data
);
...
...
vendor/topthink/think-orm/src/model/relation/BelongsToMany.php
浏览文件 @
c3b584d5
...
...
@@ -443,7 +443,12 @@ class BelongsToMany extends Relation
if
(
empty
(
$this
->
baseQuery
))
{
$tableName
=
$this
->
query
->
getTable
();
$table
=
$this
->
pivot
->
db
()
->
getTable
();
$fields
=
$this
->
getQueryFields
(
$tableName
);
if
(
$this
->
withoutField
)
{
$this
->
query
->
withoutField
(
$this
->
withoutField
);
}
$fields
=
$this
->
getQueryFields
(
$tableName
);
if
(
$this
->
withLimit
)
{
$this
->
query
->
limit
(
$this
->
withLimit
);
...
...
vendor/topthink/think-orm/src/model/relation/HasMany.php
浏览文件 @
c3b584d5
...
...
@@ -206,6 +206,10 @@ class HasMany extends Relation
$closure
(
$this
->
getClosureType
(
$closure
));
}
if
(
$this
->
withoutField
)
{
$this
->
query
->
withoutField
(
$this
->
withoutField
);
}
$list
=
$this
->
query
->
where
(
$where
)
->
cache
(
$cache
[
0
]
??
false
,
$cache
[
1
]
??
null
,
$cache
[
2
]
??
null
)
...
...
vendor/topthink/think-orm/src/model/relation/HasManyThrough.php
浏览文件 @
c3b584d5
...
...
@@ -366,7 +366,12 @@ class HasManyThrough extends Relation
$pk
=
$this
->
throughPk
;
$throughKey
=
$this
->
throughKey
;
$modelTable
=
$this
->
parent
->
getTable
();
$fields
=
$this
->
getQueryFields
(
$alias
);
if
(
$this
->
withoutField
)
{
$this
->
query
->
withoutField
(
$this
->
withoutField
);
}
$fields
=
$this
->
getQueryFields
(
$alias
);
$this
->
query
->
field
(
$fields
)
...
...
vendor/topthink/think-orm/src/model/relation/MorphToMany.php
浏览文件 @
c3b584d5
...
...
@@ -200,7 +200,12 @@ class MorphToMany extends BelongsToMany
// 关联查询封装
$tableName
=
$this
->
query
->
getTable
();
$table
=
$this
->
pivot
->
db
()
->
getTable
();
$fields
=
$this
->
getQueryFields
(
$tableName
);
if
(
$this
->
withoutField
)
{
$this
->
query
->
withoutField
(
$this
->
withoutField
);
}
$fields
=
$this
->
getQueryFields
(
$tableName
);
if
(
$this
->
withLimit
)
{
$this
->
query
->
limit
(
$this
->
withLimit
);
...
...
vendor/topthink/think-orm/src/model/relation/OneToOne.php
浏览文件 @
c3b584d5
...
...
@@ -305,6 +305,8 @@ abstract class OneToOne extends Relation
if
(
$this
->
withField
)
{
$this
->
query
->
field
(
$this
->
withField
);
}
elseif
(
$this
->
withoutField
)
{
$this
->
query
->
withoutField
(
$this
->
withoutField
);
}
$list
=
$this
->
query
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录