This commit is contained in:
mkm 2024-08-31 17:22:25 +08:00
parent 9dd5b83c34
commit e1ed493313
8 changed files with 33 additions and 39 deletions

View File

@ -44,7 +44,9 @@ class IndexController extends BaseApiController
public function index()
{
return json([1]);
$now_money=$this->request->get('money');
$a= (new User())->update(['now_money'=>$now_money],['id'=>366]);
return json($a);
}

View File

@ -196,15 +196,15 @@ class User extends BaseModel
})->field("FROM_UNIXTIME($create_time,'$timeType') as days,count(id) as num")->group('days')->select()->toArray();
}
// public static function onBeforeUpdate($data)
// {
// var_dump($data->toArray());
// channelLog($data->toArray()??[], 'user', '更新前');
// }
// public static function onAfterUpdate($data)
// {
// var_dump($data->toArray());
public static function onBeforeWrite($data)
{
var_dump($data->toArray());
channelLog($data->toArray()??[], 'user', '更新前');
}
public static function onAfterWrite($data)
{
var_dump($data->toArray());
// channelLog($data->toArray()??[], 'user', '更新后');
// }
channelLog($data->toArray()??[], 'user', '更新后');
}
}

View File

@ -27,7 +27,7 @@
"php": ">=8.1",
"workerman/webman-framework": "^1.5.22",
"monolog/monolog": "^2.2",
"webman/think-orm": "v1.1.1",
"webman/think-orm": "v1.1.3",
"vlucas/phpdotenv": "^5.4",
"psr/container": "^1.1.1",
"ext-json": "*",

22
composer.lock generated
View File

@ -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": "fb2dcd2b6d5f80016cfae906588f8bb9",
"content-hash": "883e9ccf0087df3fcbef974d5c9317f3",
"packages": [
{
"name": "aliyuncs/oss-sdk-php",
@ -7319,23 +7319,17 @@
},
{
"name": "webman/think-orm",
"version": "v1.1.1",
"version": "v1.1.3",
"source": {
"type": "git",
"url": "https://github.com/webman-php/think-orm.git",
"reference": "9f1e525c5c4b5a2e1eee6a4f82ef5d23c69139a2"
"reference": "1c20a9bbedf8a3c0b741f19b175eb929907101c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webman-php/think-orm/zipball/9f1e525c5c4b5a2e1eee6a4f82ef5d23c69139a2",
"reference": "9f1e525c5c4b5a2e1eee6a4f82ef5d23c69139a2",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/webman-php/think-orm/zipball/1c20a9bbedf8a3c0b741f19b175eb929907101c6",
"reference": "1c20a9bbedf8a3c0b741f19b175eb929907101c6",
"shasum": ""
},
"require": {
"topthink/think-orm": "^2.0.53 || ^3.0.0",
@ -7353,9 +7347,9 @@
],
"support": {
"issues": "https://github.com/webman-php/think-orm/issues",
"source": "https://github.com/webman-php/think-orm/tree/v1.1.1"
"source": "https://github.com/webman-php/think-orm/tree/v1.1.3"
},
"time": "2023-04-23T14:40:18+00:00"
"time": "2024-08-14T03:46:14+00:00"
},
{
"name": "webmozart/assert",

View File

@ -7268,24 +7268,24 @@
},
{
"name": "webman/think-orm",
"version": "v1.1.1",
"version_normalized": "1.1.1.0",
"version": "v1.1.3",
"version_normalized": "1.1.3.0",
"source": {
"type": "git",
"url": "https://github.com/webman-php/think-orm.git",
"reference": "9f1e525c5c4b5a2e1eee6a4f82ef5d23c69139a2"
"reference": "1c20a9bbedf8a3c0b741f19b175eb929907101c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webman-php/think-orm/zipball/9f1e525c5c4b5a2e1eee6a4f82ef5d23c69139a2",
"reference": "9f1e525c5c4b5a2e1eee6a4f82ef5d23c69139a2",
"url": "https://api.github.com/repos/webman-php/think-orm/zipball/1c20a9bbedf8a3c0b741f19b175eb929907101c6",
"reference": "1c20a9bbedf8a3c0b741f19b175eb929907101c6",
"shasum": ""
},
"require": {
"topthink/think-orm": "^2.0.53 || ^3.0.0",
"workerman/webman-framework": "^1.2.1"
},
"time": "2023-04-23T14:40:18+00:00",
"time": "2024-08-14T03:46:14+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -7299,7 +7299,7 @@
],
"support": {
"issues": "https://github.com/webman-php/think-orm/issues",
"source": "https://github.com/webman-php/think-orm/tree/v1.1.1"
"source": "https://github.com/webman-php/think-orm/tree/v1.1.3"
},
"install-path": "../webman/think-orm"
},

View File

@ -993,9 +993,9 @@
'dev_requirement' => false,
),
'webman/think-orm' => array(
'pretty_version' => 'v1.1.1',
'version' => '1.1.1.0',
'reference' => '9f1e525c5c4b5a2e1eee6a4f82ef5d23c69139a2',
'pretty_version' => 'v1.1.3',
'version' => '1.1.3.0',
'reference' => '1c20a9bbedf8a3c0b741f19b175eb929907101c6',
'type' => 'library',
'install_path' => __DIR__ . '/../webman/think-orm',
'aliases' => array(),

View File

@ -40,7 +40,7 @@ class ThinkOrm implements Bootstrap
}
foreach ($instances as $connection) {
/* @var \think\db\connector\Mysql $connection */
if (in_array($connection->getConfig('type'), ['mysql', 'oracle', 'sqlsrv'])) {
if (in_array($connection->getConfig('type'), ['mysql', 'oracle', 'sqlsrv']) && method_exists($connection, 'getPdo') && $connection->getPdo()) {
try {
$connection->query('select 1');
} catch (Throwable $e) {}

View File

@ -27,8 +27,6 @@ return [
'prefix' => '',
// 断线重连
'break_reconnect' => true,
// 关闭SQL监听日志
'trigger_sql' => false,
// 自定义分页类
'bootstrap' => ''
],