biz9-logic 4.9.3 → 4.9.4

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 CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='8.7.3'
1
+ VERSION='8.7.4'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -148,8 +148,10 @@ class Demo_Logic {
148
148
  item_title_list.push(title+" " +Type.get_title(item.categorys[Num.get_id(item.categorys.length)].category)+" "+ b);
149
149
  }
150
150
  }
151
- for(const cat_item of item.categorys){
151
+ const cat_item = item.categorys[Num.get_id(item.categorys.length)];
152
+ if(!cat_item.items){
152
153
  cat_item.items = [];
154
+ }
153
155
  for(const item of item_title_list){
154
156
  let child_item = Item_Logic.get_new(item,option.item_data_type);
155
157
  if(option.item_data_type == DataType.PRODUCT){
@@ -163,7 +165,6 @@ class Demo_Logic {
163
165
  child_item.note = Field_Logic.get_test_note(),
164
166
  cat_item.items.push(child_item);
165
167
  }
166
- }
167
168
  }
168
169
  return item;
169
170
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.9.3",
3
+ "version": "4.9.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -31,19 +31,32 @@ describe("connect", () => {
31
31
  series([
32
32
  function(call) {
33
33
  console.log('CONNECT-START');
34
- let demo_type_1 = Demo_Logic.get_new_type('Computer',{
35
- get_category:true,category_count:9,category_data_type:DataType.PRODUCT,categorys:'',
36
- get_item:true,item_count:9,item_data_type:DataType.PRODUCT,items:null});
37
- //Log.w('demo_type_1_categorys',demo_type_1.categorys);
38
- //Log.w('demo_type_1_categorys',demo_type_1.categorys[0]);
34
+ let post_type_list = [
35
+ Demo_Logic.get_new_type('Computer 1',{
36
+ get_category:true,category_count:12,category_data_type:DataType.PRODUCT,categorys:'',
37
+ get_item:true,item_count:50,item_data_type:DataType.PRODUCT,items:null}),
38
+ Demo_Logic.get_new_type('Computer 2',{
39
+ get_category:true,category_count:12,category_data_type:DataType.PRODUCT,categorys:'',
40
+ get_item:true,item_count:50,item_data_type:DataType.PRODUCT,items:null})
41
+ ];
39
42
 
40
- //Log.w('demo_type_1',demo_type_1);
41
- let total = 0;
42
- for(a=0;a<demo_type_1.categorys.length;a++){
43
- console.log(demo_type_1.categorys[a]);
44
- total = total+1;
45
- }
46
- Log.w('total',total);
43
+ Log.w('post_type_list',post_type_list);
44
+ let post_item_count = 0;
45
+ let post_category_count = 0;
46
+ for(const item_type of post_type_list){
47
+ for(const item_cat of item_type.categorys){
48
+ post_category_count = post_category_count+1;
49
+ if(!item_cat.items){
50
+ item_cat.items = []
51
+ }
52
+ for(const item_item of item_cat.items){
53
+ post_item_count = post_item_count+1;
54
+ }
55
+ }
56
+ };
57
+
58
+ Log.w('post_type_list',post_type_list);
59
+ Log.w('post_item_count',post_item_count);
47
60
 
48
61
  console.log('CONNECT-END');
49
62
  call();