mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
Merge branch 'master' of https://github.com/top-think/framework
This commit is contained in:
@@ -25,10 +25,10 @@ use think\console\output\question\Confirmation;
|
|||||||
* Class Output
|
* Class Output
|
||||||
* @package think\console
|
* @package think\console
|
||||||
*
|
*
|
||||||
* @see think\console\output\driver\Console::setDecorated
|
* @see \think\console\output\driver\Console::setDecorated
|
||||||
* @method void setDecorated($decorated)
|
* @method void setDecorated($decorated)
|
||||||
*
|
*
|
||||||
* @see think\console\output\driver\Buffer::fetch
|
* @see \think\console\output\driver\Buffer::fetch
|
||||||
* @method string fetch()
|
* @method string fetch()
|
||||||
*
|
*
|
||||||
* @method void info($message)
|
* @method void info($message)
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ class Console
|
|||||||
{
|
{
|
||||||
if (DIRECTORY_SEPARATOR === '\\') {
|
if (DIRECTORY_SEPARATOR === '\\') {
|
||||||
return
|
return
|
||||||
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD)
|
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD
|
||||||
|| false !== getenv('ANSICON')
|
|| false !== getenv('ANSICON')
|
||||||
|| 'ON' === getenv('ConEmuANSI')
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|| 'xterm' === getenv('TERM');
|
|| 'xterm' === getenv('TERM');
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class Pgsql extends Builder
|
|||||||
$key = trim($key);
|
$key = trim($key);
|
||||||
if (strpos($key, '$.') && false === strpos($key, '(')) {
|
if (strpos($key, '$.') && false === strpos($key, '(')) {
|
||||||
// JSON字段支持
|
// JSON字段支持
|
||||||
list($field, $name) = explode($key, '$.');
|
list($field, $name) = explode('$.', $key);
|
||||||
$key = $field . '->>\'' . $name . '\'';
|
$key = $field . '->>\'' . $name . '\'';
|
||||||
}
|
}
|
||||||
return $key;
|
return $key;
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ class Relation
|
|||||||
// 保存关联表数据
|
// 保存关联表数据
|
||||||
$model = new $this->model;
|
$model = new $this->model;
|
||||||
$id = $model->save($data);
|
$id = $model->save($data);
|
||||||
} elseif (is_numeric($data)) {
|
} elseif (is_numeric($data) || is_string($data)) {
|
||||||
// 根据关联表主键直接写入中间表
|
// 根据关联表主键直接写入中间表
|
||||||
$id = $data;
|
$id = $data;
|
||||||
} elseif ($data instanceof Model) {
|
} elseif ($data instanceof Model) {
|
||||||
@@ -634,7 +634,7 @@ class Relation
|
|||||||
{
|
{
|
||||||
if (is_array($data)) {
|
if (is_array($data)) {
|
||||||
$id = $data;
|
$id = $data;
|
||||||
} elseif (is_numeric($data)) {
|
} elseif (is_numeric($data) || is_string($data)) {
|
||||||
// 根据关联表主键直接写入中间表
|
// 根据关联表主键直接写入中间表
|
||||||
$id = $data;
|
$id = $data;
|
||||||
} elseif ($data instanceof Model) {
|
} elseif ($data instanceof Model) {
|
||||||
|
|||||||
Reference in New Issue
Block a user