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

The data returned by create api is inconsistent with the data just inserted in the database #4013

Closed
yuenshui opened this issue Sep 26, 2018 · 2 comments
Labels

Comments

@yuenshui
Copy link

Description/Steps to reproduce

  1. mysql database
  2. type:datetime
  3. model json :
    "created": {
      "type": "date",
      "required": true,
      "defaultFn": "now"
    }
  1. use model create(), insert a line data.
  2. returned result object
  3. the model findById(result.id), returned object
  4. the creation property of two objects is one second difference
null: ad_stats {__cachedRelations: Object, __data: Object, __dataSource: undefined, __strict: false, __persisted: true,}
__cachedRelations: Object {}
__data: Object {openId: "H4xUDVzUCxYriWmwEiHvRQ==", fromOpenId: "H4xUDVzUCxYriWmwEiHvRQ==", configId: "1",}
__dataSource: undefined
__persisted: true
__strict: false
$amount: 200
$coinId: "TMT"
$collected: false
$configId: "1"
$countBy: 20180926
$created: Wed Sep 26 2018 15:19:19 GMT+0800 (CST)
$fromOpenId: "H4xUDVzUCxYriWmwEiHvRQ=="
$id: 6
$openId: "H4xUDVzUCxYriWmwEiHvRQ=="
amount: 200
coinId: "TMT"
collected: false
configId: "1"
countBy: 20180926
created: Wed Sep 26 2018 15:19:19 GMT+0800 (CST)
__proto__: Object {constructor: , toString: , toDateString: , }
errors: false
fromOpenId: "H4xUDVzUCxYriWmwEiHvRQ=="
id: 6
limit: 1
offset: 0
openId: "H4xUDVzUCxYriWmwEiHvRQ=="
order: Array(1) ["id"]
skip: 0
__proto__: PersistedModel {id: <accessor>, openId: <accessor>, fromOpenId: <accessor>, …}
null: ad_stats {__cachedRelations: Object, __data: Object, __dataSource: undefined, __strict: false, __persisted: true}
__cachedRelations: Object {}
__data: Object {id: 6, openId: "H4xUDVzUCxYriWmwEiHvRQ==", fromOpenId: "H4xUDVzUCxYriWmwEiHvRQ==", }
__dataSource: undefined
__persisted: true
__strict: false
$amount: 200
$coinId: "TMT"
$collected: false
$configId: "1"
$countBy: 20180926
$created: Wed Sep 26 2018 15:19:20 GMT+0800 (CST)
$fromOpenId: "H4xUDVzUCxYriWmwEiHvRQ=="
$id: 6
$openId: "H4xUDVzUCxYriWmwEiHvRQ=="
amount: 200
coinId: "TMT"
collected: false
configId: "1"
countBy: 20180926
created: Wed Sep 26 2018 15:19:20 GMT+0800 (CST)
fromOpenId: "H4xUDVzUCxYriWmwEiHvRQ=="
id: 6
openId: "H4xUDVzUCxYriWmwEiHvRQ=="
__proto__: PersistedModel {id: <accessor>, openId: <accessor>, fromOpenId: <accessor>, }

Link to reproduction sandbox

Expected result

Additional information

@stale
Copy link

stale bot commented Sep 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 17, 2019
@stale
Copy link

stale bot commented Oct 2, 2019

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant