Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor db #13

Merged
merged 32 commits into from
Apr 10, 2018
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4bbd6f9
Merge pull request #9 from swoft-cloud/master
stelin Mar 24, 2018
a215317
refactor db
stelin Mar 27, 2018
819697a
ts
stelin Mar 28, 2018
f861b7d
select db
stelin Mar 29, 2018
cd0384e
batchInsert and Simplified operation
stelin Apr 1, 2018
8c95fb6
add batch unit
stelin Apr 1, 2018
61896ac
refactor unit
stelin Apr 1, 2018
348be27
add condition
stelin Apr 1, 2018
8a4c506
remove className
stelin Apr 9, 2018
5cd22b0
add AR
stelin Apr 9, 2018
5108b80
add unit
stelin Apr 9, 2018
3bdb799
add unit
stelin Apr 9, 2018
777f317
Update context key
huangzhhui Apr 10, 2018
5d894a6
Fix unit test
huangzhhui Apr 10, 2018
c34bbe8
Merge branch 'feature' of github.com:swoft-cloud/swoft-db into feature
huangzhhui Apr 10, 2018
4a67ca0
format .travis.yml sql
huangzhhui Apr 10, 2018
91b7829
add pdo requires and use feature branch framework requires
huangzhhui Apr 10, 2018
e4ae05d
fix method type
huangzhhui Apr 10, 2018
10962cd
revert getContextConnKey method name to getContextCntKey
huangzhhui Apr 10, 2018
5d433ea
Add decorators mechanism for Db result, and add exist() method to Model
huangzhhui Apr 10, 2018
93d26c4
add options
stelin Apr 10, 2018
5c92624
Rename method name addOptions to applyOptions
huangzhhui Apr 10, 2018
31104d0
simplify code
huangzhhui Apr 10, 2018
44a5d57
add count
stelin Apr 10, 2018
4bc7556
Merge branch 'feature' of https://github.com/swoft-cloud/swoft-db int…
stelin Apr 10, 2018
5f8c020
add .php_cs and format code, and rename test namespace
huangzhhui Apr 10, 2018
8494adb
Merge branch 'feature' of github.com:swoft-cloud/swoft-db into feature
huangzhhui Apr 10, 2018
5b1b96c
format
huangzhhui Apr 10, 2018
1fb99eb
Update README.md
huangzhhui Apr 10, 2018
687ba5b
Update README.md
inhere Apr 10, 2018
93cd418
run code inspect check
inhere Apr 10, 2018
3b16018
Merge pull request #12 from swoft-cloud/inhere-patch-1
stelin Apr 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
format
  • Loading branch information
huangzhhui committed Apr 10, 2018
commit 5b1b96c67c5c1aaebc1c6991609cd29909c6af9c
4 changes: 2 additions & 2 deletions src/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ public static function exist(string $className, $id): ResultInterface
public static function count(string $className, string $column, array $condition): ResultInterface
{
$instance = self::getInstance($className);
$query = Query::table($className)->selectInstance($instance)->condition($condition)->addDecorator(function ($result){
if(isset($result['count'])){
$query = Query::table($className)->selectInstance($instance)->condition($condition)->addDecorator(function ($result) {
if (isset($result['count'])) {
return $result['count'];
}
return 0;
Expand Down