q-koa 9.7.0 → 9.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ module.exports = {
2
+ name: '首页数据看板',
3
+ belongs: 'page',
4
+ multiple: false,
5
+ availableSort: true,
6
+ order: [],
7
+ referenceSelect: [],
8
+ select: [{"key":"name"}],
9
+ excludes: [],
10
+ limit: 20,
11
+ defaultOrder: [{"sort":"ascending","type":"sortOrder"}],
12
+ comment: {},
13
+ sortOrder: 1,
14
+ reference: [],
15
+ excludeAuth: [],
16
+ initList: [],
17
+ editInline: {},
18
+ autoData: {},
19
+ is_split: false,
20
+ is_split_count: false,
21
+ show_virtual: false,
22
+ modelQuery: {},
23
+ deleteCheckList: [],
24
+ bulkCreateList: [],
25
+ };
@@ -0,0 +1,69 @@
1
+ const { Sequelize, Random } = require('q-koa');
2
+
3
+
4
+ exports.name = {
5
+ type: Sequelize.STRING,
6
+ comment: '名字',
7
+ allowNull: false,
8
+ is_mock: true,
9
+ defaultValue: '',
10
+ sortOrder: 1,
11
+ mock: () => Random.ctitle(),
12
+ }
13
+
14
+ exports.data_list = {
15
+ type: Sequelize.JSON,
16
+ comment: '依赖',
17
+ allowNull: false,
18
+ is_mock: false,
19
+ defaultValue: [],
20
+ sortOrder: 2,
21
+ get: function () {
22
+ return this.getDataValue('data_list') || []
23
+ },
24
+ }
25
+
26
+ exports.desc = {
27
+ type: Sequelize.TEXT,
28
+ comment: '介绍',
29
+ allowNull: false,
30
+ is_mock: true,
31
+ defaultValue: '',
32
+ sortOrder: 3,
33
+ mock: () => Random.csentence(),
34
+ extra: {"type":"markdown"},
35
+ }
36
+
37
+ exports.role_id = {
38
+ type: Sequelize.JSON,
39
+ comment: '角色',
40
+ allowNull: false,
41
+ is_mock: true,
42
+ defaultValue: [],
43
+ sortOrder: 4,
44
+ mock: () => Random.range(2).map((item, index) => Random.integer(1, 5)),
45
+ get: function () {
46
+ return this.getDataValue('role_id') || []
47
+ },
48
+ }
49
+
50
+ exports.sortOrder = {
51
+ type: Sequelize.MEDIUMINT.UNSIGNED,
52
+ comment: '排序',
53
+ allowNull: false,
54
+ is_mock: false,
55
+ defaultValue: 0,
56
+ sortOrder: 5,
57
+
58
+ }
59
+
60
+ exports.is_on = {
61
+ type: Sequelize.BOOLEAN,
62
+ comment: '是否',
63
+ allowNull: false,
64
+ is_mock: true,
65
+ defaultValue: true,
66
+ sortOrder: 6,
67
+ mock: () => Random.boolean(),
68
+ extra: {"controlInline":true},
69
+ }
@@ -153,8 +153,19 @@ exports.cash = async ({
153
153
  }) => {
154
154
  const { app, appName } = getAppByCtx(ctx)
155
155
  const appConfig = getConfig(app)
156
+
157
+ const user = await app.model.user.findOne({
158
+ where: {
159
+ id: user_id,
160
+ },
161
+ include: app.model.mp_user,
162
+ })
163
+
164
+ if (!user) throw new Error('找不到该用户')
165
+ if (!user.mp_user.openid) throw new Error('找不到该用户openid')
166
+
156
167
  const { mchId, key, appId, partner_key } = await appConfig.getObject(
157
- pay_config
168
+ user.mp_user.appid || pay_config
158
169
  )
159
170
 
160
171
  const { is_dev } = await appConfig.getObject('base')
@@ -170,17 +181,6 @@ exports.cash = async ({
170
181
  )
171
182
  ), // 微信商户平台证书
172
183
  })
173
-
174
- const user = await app.model.user.findOne({
175
- where: {
176
- id: user_id,
177
- },
178
- include: app.model.mp_user,
179
- })
180
-
181
- if (!user) throw new Error('找不到该用户')
182
- if (!user.mp_user.openid) throw new Error('找不到该用户openid')
183
-
184
184
  const amount = Number((Math.abs(number) * 100).toFixed(0))
185
185
 
186
186
  const result = await payObj.transfers({
@@ -38,7 +38,8 @@ exports.getObject = (config, app) => async (type) => {
38
38
  item.key === type ||
39
39
  item.config === type ||
40
40
  item.pay_config === type ||
41
- (item.ToUserName && item.ToUserName === type)
41
+ (item.ToUserName && item.ToUserName === type) ||
42
+ (item.appId && item.appId === type)
42
43
  if (app) {
43
44
  const applicationList = app.cache.get('application')
44
45
  if (applicationList && applicationList.find(findConfig)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "9.7.0",
3
+ "version": "9.7.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {