biz9-logic 4.9.3 → 4.9.6
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 +5 -4
- package/package.json +1 -1
- package/test.js +25 -12
package/biz9_config
CHANGED
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
|
-
|
|
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
|
};
|
|
@@ -451,7 +452,7 @@ class Page_Logic {
|
|
|
451
452
|
class Order_Logic {
|
|
452
453
|
static get_new = (cart) => {
|
|
453
454
|
let order = DataItem.get_new(DataType.ORDER,0,{
|
|
454
|
-
order_number:
|
|
455
|
+
order_number:Type.ORDER_NUMBER + Num.get_id(99999),
|
|
455
456
|
parent_data_type:cart.parent_data_type,
|
|
456
457
|
user_id:cart.user_id,
|
|
457
458
|
cart_number:cart.cart_number,
|
|
@@ -495,7 +496,7 @@ class Order_Logic {
|
|
|
495
496
|
}
|
|
496
497
|
class Cart_Logic {
|
|
497
498
|
static get_new = (parent_data_type,user_id) => {
|
|
498
|
-
return DataItem.get_new(DataType.CART,0,{user_id:user_id,cart_number:
|
|
499
|
+
return DataItem.get_new(DataType.CART,0,{user_id:user_id,cart_number:Type.CART_NUMBER + Num.get_id(99999),parent_data_type:parent_data_type,grand_total:0,cart_item_list:[]});
|
|
499
500
|
};
|
|
500
501
|
static get_new_cart_item = (parent_data_type,parent_id,cart_number,quanity) =>{
|
|
501
502
|
return DataItem.get_new(DataType.CART_ITEM,0,{parent_data_type:parent_data_type,parent_id:parent_id,cart_number:cart_number,quanity:quanity,cart_sub_item_list:[]});
|
package/package.json
CHANGED
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
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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:500,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:500,item_data_type:DataType.PRODUCT,items:null})
|
|
41
|
+
];
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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();
|