biz9-logic 4.8.58 → 4.8.62
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 +59 -2
- package/package.json +1 -1
- package/test.js +18 -3
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -43,6 +43,54 @@ class Item_Logic {
|
|
|
43
43
|
}
|
|
44
44
|
return item_list;
|
|
45
45
|
}
|
|
46
|
+
static get_search_query(search){
|
|
47
|
+
let url = "";
|
|
48
|
+
if(search.data_type){
|
|
49
|
+
url = url + "&data_type="+search.data_type;
|
|
50
|
+
}else{
|
|
51
|
+
url = url + "&data_type="+DataType.BLANK;
|
|
52
|
+
}
|
|
53
|
+
if(search.sort_by_key){
|
|
54
|
+
url = url + "&sort_by_key="+search.sort_by_key;
|
|
55
|
+
}else{
|
|
56
|
+
url = url + "&sort_by_key=title";
|
|
57
|
+
}
|
|
58
|
+
if(search.sort_by_value){
|
|
59
|
+
url = url + "&sort_by_value="+search.sort_by_value;
|
|
60
|
+
}else{
|
|
61
|
+
url = url + "&sort_by_value=-1";
|
|
62
|
+
}
|
|
63
|
+
if(search.page_current){
|
|
64
|
+
url = url + "&page_current="+search.page_current;
|
|
65
|
+
}else{
|
|
66
|
+
url = url + "&page_current=1";
|
|
67
|
+
}
|
|
68
|
+
if(search.page_size){
|
|
69
|
+
url = url + "&page_size="+search.page_size;
|
|
70
|
+
}else{
|
|
71
|
+
url = url + "&page_size=9";
|
|
72
|
+
}
|
|
73
|
+
for(let a=1;a<19;a++){
|
|
74
|
+
if(!Str.check_is_null(search['filter_key_'+String(a)])){
|
|
75
|
+
url = url + "&filter_key_"+String(a)+"="+ search['filter_key_'+String(a)];
|
|
76
|
+
url = url + "&filter_value_"+String(a)+"="+ search['filter_value_'+String(a)];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return url;
|
|
80
|
+
}
|
|
81
|
+
static get_search_by_query(query){
|
|
82
|
+
let filter = [];
|
|
83
|
+
let sort_by = [];
|
|
84
|
+
if(query['sort_by_key']){
|
|
85
|
+
sort_by[query['sort_by_key']] = query['sort_by_value'];
|
|
86
|
+
}
|
|
87
|
+
for(let a = 0; a < 19; a++){
|
|
88
|
+
if(query['filter_key_'+a]){
|
|
89
|
+
filter[query['filter_key_'+a]] = query['filter_value_'+a]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return Item_Logic.get_search(query.data_type,filter,sort_by,query.page_current,query.page_size);
|
|
93
|
+
}
|
|
46
94
|
static get_search = (data_type,filter,sort_by,page_current,page_size) => {
|
|
47
95
|
return {data_type:data_type,filter:filter,sort_by:sort_by,page_current:page_current,page_size:page_size};
|
|
48
96
|
}
|
|
@@ -60,7 +108,12 @@ class Template_Logic {
|
|
|
60
108
|
DataItem.get_new(DataType.TEMPLATE,0),
|
|
61
109
|
Field_Logic.get_test(title,option));
|
|
62
110
|
if(option.get_item){
|
|
63
|
-
|
|
111
|
+
let title_list = ['Header','Body','Footer','Navigation']
|
|
112
|
+
//template.items = Sub_Item_Logic.get_test_list(template,template,option);
|
|
113
|
+
template.items = [];
|
|
114
|
+
for(let a = 0; a<title_list.length;a++){
|
|
115
|
+
template.items.push(Sub_Item_Logic.get_test(title_list[a],template,template,option));
|
|
116
|
+
}
|
|
64
117
|
if(option.get_item_bind){
|
|
65
118
|
template = Sub_Item_Logic.bind_parent_child_list(template,template.items);
|
|
66
119
|
}
|
|
@@ -471,7 +524,7 @@ class Field_Logic {
|
|
|
471
524
|
option.section_count = option.section_count ? option.section_count : 9;
|
|
472
525
|
option.get_section = option.get_section ? true : false;
|
|
473
526
|
}
|
|
474
|
-
if(
|
|
527
|
+
if(data_type==DataType.PRODUCT){
|
|
475
528
|
option.product_count = option.product_count ? option.product_count : 9;
|
|
476
529
|
}
|
|
477
530
|
if(data_type==DataType.SERVICE){
|
|
@@ -589,6 +642,10 @@ class PageType {
|
|
|
589
642
|
static BLOG_POST_BROWSE='blog_post_browse';
|
|
590
643
|
static BLOG_POST_DETAIL='blog_post_detail';
|
|
591
644
|
|
|
645
|
+
static CATEGORY='category';
|
|
646
|
+
static CATEGORY_BROWSE='category_browse';
|
|
647
|
+
static CATEGORY_DETAIL='category_detail';
|
|
648
|
+
|
|
592
649
|
static EVENT='event';
|
|
593
650
|
static EVENT_BROWSE='event_browse';
|
|
594
651
|
static EVENT_DETAIL='event_detail';
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -82,6 +82,21 @@ describe("connect", () => {
|
|
|
82
82
|
|
|
83
83
|
/* --SEARCH--START */
|
|
84
84
|
//console.log(Url.get_search(DataType.BLOG_POST,{title:-1},{cool:-1},1,10));
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
let data_type = DataType.PRODUCT;
|
|
88
|
+
let search_filter_key_1 = 'key1';
|
|
89
|
+
let search_filter_value_1 = 'value1';
|
|
90
|
+
let search_filter_key_2 = 'key2';
|
|
91
|
+
let search_filter_value_2 = 'value2';
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
//let query = "?app_id=19&data_type="+data_type+"&sort_by={}&page_current=1&page_size=99&search_filter_key_1="+search_filter_key_1+"&search_filter_value_1="+search_filter_value_1+"&search_filter_key_2="+search_filter_key_2+"&search_filter_value_2="+search_filter_value_2;
|
|
96
|
+
|
|
97
|
+
//Log.w('query',query);
|
|
98
|
+
|
|
99
|
+
|
|
85
100
|
/* --SEARCH--END */
|
|
86
101
|
|
|
87
102
|
/* --CATEGORY--START */
|
|
@@ -198,11 +213,11 @@ describe("connect", () => {
|
|
|
198
213
|
|
|
199
214
|
/* --TEMPLATE--START */
|
|
200
215
|
//let template = Template_Logic.get_test("Primary",{});
|
|
201
|
-
|
|
216
|
+
let template = Template_Logic.get_test("Primary",{get_value:true,get_item:true});
|
|
202
217
|
/*
|
|
203
218
|
let template_item_list = Template_Logic.get_test("Primary",template,template,{get_value:false,get_item:false,item_count:2});
|
|
204
219
|
*/
|
|
205
|
-
|
|
220
|
+
Log.w('template',template);
|
|
206
221
|
//Log.w('template_item_list',template_item_list);
|
|
207
222
|
/* --TEMPLATE--END */
|
|
208
223
|
|
|
@@ -277,7 +292,7 @@ describe("connect", () => {
|
|
|
277
292
|
|
|
278
293
|
/* --REVIEW--START */
|
|
279
294
|
//Log.w("Review",Review.get_test());
|
|
280
|
-
Log.w("Review List",Review_Logic.get_test_list());
|
|
295
|
+
//Log.w("Review List",Review_Logic.get_test_list());
|
|
281
296
|
/*
|
|
282
297
|
let review_list = Review.get_test_list({review_count:3,get_item:true})
|
|
283
298
|
Log.w("Review List",review_list);
|