biz9-logic 4.9.32 → 4.9.36

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='9.0.2'
1
+ VERSION='9.0.6'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -127,7 +127,11 @@ class Demo_Logic {
127
127
  let category_title_list = [];
128
128
  if(option.categorys){
129
129
  category_title_list = option.categorys.split(',');
130
+ option.category_count = category_title_list.length;
130
131
  }else{
132
+ if(!option.category_count){
133
+ option.category_count = 1;
134
+ }
131
135
  for(let a = 1;a<parseInt(option.category_count)+1;a++){
132
136
  category_title_list.push(title + " Category " +a);
133
137
  }
@@ -137,20 +141,23 @@ class Demo_Logic {
137
141
  });
138
142
  }
139
143
  if(option.get_item){
144
+ let full_item_list = [];
145
+
140
146
  let item_title_list = [];
141
147
  if(option.items){
142
148
  item_title_list = option.items.split(',');
149
+ option.item_count = item_title_list.length;
143
150
  }else{
144
151
  for(let b = 1;b<parseInt(option.item_count)+1;b++){
145
- item_title_list.push(title+" " +Type.get_title(item.categorys[Num.get_id(item.categorys.length)].category)+" "+ b);
152
+ item_title_list.push(title+" " +Type.get_title(item.categorys[Num.get_id(option.category_count)].category)+" "+ b);
146
153
  }
147
154
  }
148
- const cat_item = item.categorys[Num.get_id(item.categorys.length)];
149
- if(!cat_item.items){
150
- cat_item.items = [];
151
- }
152
- for(const item of item_title_list){
153
- let child_item = Item_Logic.get_new(item,option.item_data_type);
155
+ for(const child_item_title of item_title_list){
156
+ const cat_item = item.categorys[Num.get_id(option.category_count)];
157
+ if(!cat_item.items){
158
+ cat_item.items = [];
159
+ }
160
+ let child_item = Item_Logic.get_new(child_item_title,option.item_data_type);
154
161
  if(option.item_data_type == DataType.PRODUCT){
155
162
  child_item.cost = Num.get_id(9000);
156
163
  child_item.old_cost = Num.get_id(90000);
@@ -161,6 +168,7 @@ class Demo_Logic {
161
168
  child_item.description = "Description "+String(Num.get_id());
162
169
  child_item.note = Field_Logic.get_test_note(),
163
170
  cat_item.items.push(child_item);
171
+ full_item_list.push(child_item);
164
172
  }
165
173
  }
166
174
  return item;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.9.32",
3
+ "version": "4.9.36",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -30,7 +30,37 @@ describe("connect", () => {
30
30
  it("_connect", () => {
31
31
  series([
32
32
  function(call) {
33
- console.log('CONNECT-START');
33
+ console.log('CONNECT-CMS-DEMO-START');
34
+
35
+ let category_type = DataType.PRODUCT;
36
+ let category_count = 12;
37
+ let item_count = 500;
38
+ let category_type_title_list = ['Add On','Admin Panel','Hosting','Landing Page','Mobile','Website'];
39
+ let category_title_list = ['Beauty','Church','Fashion','Food Trucks','Health Care','Music','Pets','Services','Service Repair','Sports','Trucking'];
40
+ let item_title_list = [];
41
+ let post_type_list = [];
42
+ let val_category_title = '';
43
+ let cat_max = 0;
44
+ let option = {get_category:true,category_count:category_count,category_data_type:category_type,categorys:val_category_title?val_category_title:null,
45
+ get_item:true,item_count:item_count,item_data_type:category_type,items:null}
46
+
47
+ for(const item of category_type_title_list){
48
+ post_type_list.push(
49
+ Demo_Logic.get_new_type(item,option));
50
+ }
51
+
52
+ Log.w('44-post_type_list',post_type_list);
53
+ Log.w('55-post_type_list-a',post_type_list.length);
54
+ Log.w('55-post_type_list-b',post_type_list[0].categorys[0].items.length);
55
+ Log.w('55-post_type_list-b',post_type_list[0].categorys[1].items.length);
56
+ Log.w('55-post_type_list-b',post_type_list[0].categorys[2].items.length);
57
+ Log.w('55-post_type_list-b',post_type_list[0].categorys[3].items.length);
58
+ Log.w('55-post_type_list-b',post_type_list[0].categorys[4].items.length);
59
+ console.log('CONNECT-CMS-DEMO-SUCCESS');
60
+
61
+ },
62
+ function(call) {
63
+ //console.log('CONNECT-START');
34
64
  //let post_cart = Cart_Logic.get_new(DataType.PRODUCT,0,);
35
65
  //let post_cart_list = [];
36
66
  //let post_cart_item = Cart_Logic.get_new_cart_item(DataType.PRODUCT,123,post_cart.cart_number,1,30);
@@ -44,7 +74,7 @@ describe("connect", () => {
44
74
  //Log.w('post_order',Order_Logic.get_new(post_cart,{get_payment_plan:true,payment_plan:Title.ORDER_PAYMENT_PLAN_1,payment_plan_status:Title.ORDER_PAYMENT_STATUS_OPEN}));
45
75
  //Log.w('post_cart_2',Cart_Logic.get_total(post_cart));
46
76
 
47
- console.log('CONNECT-END');
77
+ //console.log('CONNECT-END');
48
78
  //call();
49
79
  },
50
80
  function(call) {