biz9-logic 4.0.32 → 4.0.34
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.
- package/biz9_config +1 -1
- package/index.js +84 -13
- package/package.json +1 -1
- package/test.js +19 -6
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -112,9 +112,9 @@ class Product{
|
|
|
112
112
|
class Service{
|
|
113
113
|
static get_test = (option) =>{
|
|
114
114
|
if(!option){
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
option = {item_count:10,get_value:false,get_item:false};
|
|
116
|
+
}
|
|
117
|
+
if(!option.item_count){
|
|
118
118
|
option.item_count=10;
|
|
119
119
|
}
|
|
120
120
|
let service = DataItem.get_new_full_item(
|
|
@@ -147,11 +147,38 @@ class Service{
|
|
|
147
147
|
}
|
|
148
148
|
return item_list;
|
|
149
149
|
};
|
|
150
|
+
static get_test_list_by_category = (option) =>{
|
|
151
|
+
let service_list = [];
|
|
152
|
+
let category_count = 9;
|
|
153
|
+
let service_count = 19;
|
|
154
|
+
if(!option){
|
|
155
|
+
option={};
|
|
156
|
+
}
|
|
157
|
+
else{
|
|
158
|
+
if(option.category_count){
|
|
159
|
+
category_count = parseInt(option.category_count);
|
|
160
|
+
}
|
|
161
|
+
if(option.category_count){
|
|
162
|
+
service_count = parseInt(option.service_count);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
let category_list = Category.get_type_category_list(DataType.SERVICE,category_count);
|
|
166
|
+
let item_count = 0;
|
|
167
|
+
for(let a=0;a<category_list.length;a++){
|
|
168
|
+
for(let b=0;b<service_count;b++){
|
|
169
|
+
item_count++;
|
|
170
|
+
let service = Service.get_test({item_count:0,service_count:service_count,get_value:false,get_item:false});
|
|
171
|
+
service.category = category_list[Number.get_id(category_list.length-1)].title;
|
|
172
|
+
service_list.push(service);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return [category_list,service_list]
|
|
176
|
+
};
|
|
150
177
|
}
|
|
151
178
|
class Event{
|
|
152
179
|
static get_test = (option) =>{
|
|
153
180
|
if(!option){
|
|
154
|
-
option = {item_count:9,
|
|
181
|
+
option = {item_count:9,get_value:false,get_item:false};
|
|
155
182
|
}
|
|
156
183
|
if(!option.item_count){
|
|
157
184
|
option.item_count=10;
|
|
@@ -177,7 +204,7 @@ class Event{
|
|
|
177
204
|
}
|
|
178
205
|
event=Sub_Item.get_test_bind_item_sub_item(event);
|
|
179
206
|
}
|
|
180
|
-
|
|
207
|
+
return event;
|
|
181
208
|
};
|
|
182
209
|
static get_test_list=(option)=>{
|
|
183
210
|
if(!option){
|
|
@@ -189,6 +216,33 @@ class Event{
|
|
|
189
216
|
}
|
|
190
217
|
return item_list;
|
|
191
218
|
};
|
|
219
|
+
static get_test_list_by_category = (option) =>{
|
|
220
|
+
let event_list = [];
|
|
221
|
+
let category_count = 9;
|
|
222
|
+
let event_count = 19;
|
|
223
|
+
if(!option){
|
|
224
|
+
option={};
|
|
225
|
+
}
|
|
226
|
+
else{
|
|
227
|
+
if(option.category_count){
|
|
228
|
+
category_count = parseInt(option.category_count);
|
|
229
|
+
}
|
|
230
|
+
if(option.category_count){
|
|
231
|
+
event_count = parseInt(option.event_count);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
let category_list = Category.get_type_category_list(DataType.EVENT,category_count);
|
|
235
|
+
let item_count = 0;
|
|
236
|
+
for(let a=0;a<category_list.length;a++){
|
|
237
|
+
for(let b=0;b<event_count;b++){
|
|
238
|
+
item_count++;
|
|
239
|
+
let event = Event.get_test({item_count:0,event_count:event_count,get_value:false,get_item:false});
|
|
240
|
+
event.category = category_list[Number.get_id(category_list.length-1)].title;
|
|
241
|
+
event_list.push(event);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return [category_list,event_list]
|
|
245
|
+
};
|
|
192
246
|
}
|
|
193
247
|
class Field{
|
|
194
248
|
static get_test = (title,option) =>{
|
|
@@ -342,7 +396,7 @@ class DataType {
|
|
|
342
396
|
class Blog_Post{
|
|
343
397
|
static get_test = (option) =>{
|
|
344
398
|
if(!option){
|
|
345
|
-
option = {item_count:
|
|
399
|
+
option = {item_count:10,get_value:false,get_item:false};
|
|
346
400
|
}
|
|
347
401
|
if(!option.item_count){
|
|
348
402
|
option.item_count=10;
|
|
@@ -363,15 +417,32 @@ class Blog_Post{
|
|
|
363
417
|
}
|
|
364
418
|
return blog_post;
|
|
365
419
|
};
|
|
366
|
-
static
|
|
420
|
+
static get_test_list_by_category = (option) =>{
|
|
421
|
+
let blog_post_list = [];
|
|
422
|
+
let category_count = 9;
|
|
423
|
+
let blog_post_count = 19;
|
|
367
424
|
if(!option){
|
|
368
|
-
option
|
|
425
|
+
option={};
|
|
369
426
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
427
|
+
else{
|
|
428
|
+
if(option.category_count){
|
|
429
|
+
category_count = parseInt(option.category_count);
|
|
430
|
+
}
|
|
431
|
+
if(option.category_count){
|
|
432
|
+
blog_post_count = parseInt(option.blog_post_count);
|
|
433
|
+
}
|
|
373
434
|
}
|
|
374
|
-
|
|
435
|
+
let category_list = Category.get_type_category_list(DataType.BLOG_POST,category_count);
|
|
436
|
+
let item_count = 0;
|
|
437
|
+
for(let a=0;a<category_list.length;a++){
|
|
438
|
+
for(let b=0;b<blog_post_count;b++){
|
|
439
|
+
item_count++;
|
|
440
|
+
let blog_post = Blog_Post.get_test({item_count:0,blog_post_count:blog_post_count,get_value:false,get_item:false});
|
|
441
|
+
blog_post.category = category_list[Number.get_id(category_list.length-1)].title;
|
|
442
|
+
blog_post_list.push(blog_post);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return [category_list,blog_post_list]
|
|
375
446
|
};
|
|
376
447
|
}
|
|
377
448
|
class Review{
|
|
@@ -585,7 +656,7 @@ class Category {
|
|
|
585
656
|
DataItem.get_new(DataType.CATEGORY,"Category "+Number.get_id()),
|
|
586
657
|
DataItem.get_new(DataType.CATEGORY,0),
|
|
587
658
|
DataItem.get_new(DataType.CATEGORY,0),
|
|
588
|
-
Field.get_test("Category " +Number.get_id()));
|
|
659
|
+
Field.get_test("Category " +Number.get_id(),{get_value:false}));
|
|
589
660
|
category.type = type
|
|
590
661
|
category_list.push(category);
|
|
591
662
|
}
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -49,6 +49,10 @@ describe("connect", () => {
|
|
|
49
49
|
/* --PAGE--END */
|
|
50
50
|
|
|
51
51
|
/* --BLOG_POST--START */
|
|
52
|
+
let [category_list,blog_post_list]=Blog_Post.get_test_list_by_category({category_count:5,blog_post_count:9});
|
|
53
|
+
Log.w('blog_post_list',blog_post_list);
|
|
54
|
+
//Log.w('category_list',category_list);
|
|
55
|
+
|
|
52
56
|
//let blog_post = Blog_Post.get_test({item_count:9,blog_post_count:19,get_item:true,get_value:true})
|
|
53
57
|
//let blog_post = Blog_Post.get_test()
|
|
54
58
|
//let blog_post_list=Blog_Post.get_test_list({category_count:5,blog_post_count:9,get_value:true,get_item:true});
|
|
@@ -58,19 +62,28 @@ describe("connect", () => {
|
|
|
58
62
|
//Log.w("BLog_Post_section_1_section_1_section_1",blog_post.section_1.section_1.section_1);
|
|
59
63
|
/* --BLOG_POST--END */
|
|
60
64
|
|
|
61
|
-
|
|
62
65
|
/* --PRODUCT--START */
|
|
63
66
|
//let [category_list,product_list]=Product.get_test_list_by_category({category_count:5,product_count:9});
|
|
64
|
-
let product = Product.get_test({item_count:9,product_count:19,get_item:true,get_value:true})
|
|
65
|
-
//let product = Product.get_test()
|
|
66
67
|
//Log.w('product_list',product_list);
|
|
67
68
|
//Log.w('category_list',category_list);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
|
|
70
|
+
//let product = Product.get_test({item_count:9,product_count:19,get_item:true,get_value:true})
|
|
71
|
+
//let product = Product.get_test()
|
|
72
|
+
//Log.w("Product",product);
|
|
73
|
+
//Log.w("Product_section_1",product.section_1);
|
|
74
|
+
//Log.w("Product_section_1_section_1_section_1",product.section_1.section_1.section_1);
|
|
71
75
|
/* --PRODUCT--END */
|
|
72
76
|
|
|
77
|
+
/* --EVENT--START */
|
|
78
|
+
//let [category_list,event_list]=Event.get_test_list_by_category({category_count:5,event_count:9});
|
|
79
|
+
//Log.w('event_list',event_list);
|
|
80
|
+
//Log.w('category_list',category_list);
|
|
81
|
+
/* --EVENT--END */
|
|
82
|
+
|
|
73
83
|
/* --SERVICE--START */
|
|
84
|
+
//let [category_list,service_list]=Service.get_test_list_by_category({category_count:5,service_count:9});
|
|
85
|
+
//Log.w('service_list',service_list);
|
|
86
|
+
//Log.w('category_list',category_list);
|
|
74
87
|
/*
|
|
75
88
|
let service = Service.get_test({item_count:9,service_count:19,get_item:true,get_value:true})
|
|
76
89
|
//let service = Service.get_test()
|