Skip to content

Commit

Permalink
remove batch update (#987)
Browse files Browse the repository at this point in the history
remove batch update
  • Loading branch information
inhere committed Sep 20, 2019
2 parents b8918b4 + 072a00b commit 2925a3f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
1 change: 0 additions & 1 deletion app/Console/Command/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ private function uris(): array
'/dbModel/delete',
'/dbModel/save',
'/dbModel/batchUpdate',
'/dbModel/batchUpdateOrInsert',
'/dbModel/propWhere',
'/selectDb/modelNotExistDb',
'/selectDb/queryNotExistDb',
Expand Down
30 changes: 0 additions & 30 deletions app/Http/Controller/DbModelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,34 +164,4 @@ public function propWhere(): array

return $user->toArray();
}

/**
* @RequestMapping()
*
* @return bool
* @throws Throwable
*/
public function batchUpdateOrInsert(): bool
{
$values = [
[
'age' => 18,
'user_desc' => 'swoft' . random_int(1, 2),
'test_json' => []
],
[
'age' => 19,
'user_desc' => 'swoft1' . random_int(2, 3),
'test_json' => null
],
[
'age' => 20,
'user_desc' => 'swoft2' . random_int(4, 6),
'test_json' => ['test' => 1]
],
];
$baseWhere = ['age' => 18];

return User::batchUpdateOrInsert($values, $baseWhere, ['user_desc'], ['user_desc']);
}
}

0 comments on commit 2925a3f

Please sign in to comment.