biz9-logic 4.8.159 → 4.8.160
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 +14 -5
- package/package.json +1 -1
- package/test.js +6 -5
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -659,7 +659,6 @@ class Field_Logic {
|
|
|
659
659
|
option.member_count = option.member_count ? option.member_count : 9;
|
|
660
660
|
}
|
|
661
661
|
if(data_type==DataType.FAQ){
|
|
662
|
-
option.get_question = option.get_question ? true : false;
|
|
663
662
|
option.question_count = option.question_count ? option.question_count : 9;
|
|
664
663
|
}
|
|
665
664
|
if(data_type==DataType.CONTENT){
|
|
@@ -731,6 +730,8 @@ class Field_Logic {
|
|
|
731
730
|
let option = {};
|
|
732
731
|
option.value_count = req.query.value_count ? req.query.value_count : 9;
|
|
733
732
|
option.section_count = req.query.section_count ? req.query.section_count : 9;
|
|
733
|
+
|
|
734
|
+
option.get_faq = req.query.get_faq ? req.query.get_faq : false;
|
|
734
735
|
option.question_count = req.query.question_count ? req.query.question_count : 9;
|
|
735
736
|
|
|
736
737
|
option.get_blog_post = req.query.get_blog_post ? req.query.get_blog_post : false;
|
|
@@ -756,15 +757,16 @@ class Field_Logic {
|
|
|
756
757
|
option.get_product_review = req.query.get_product_review ? req.query.get_product_review : false;
|
|
757
758
|
option.product_review_count = req.query.product_review_count ? req.query.product_review_count : 19;
|
|
758
759
|
|
|
760
|
+
option.get_business_review = req.query.get_business_review ? req.query.get_business_review : false;
|
|
761
|
+
option.business_review_count = req.query.business_review_count ? req.query.business_review_count : 19;
|
|
762
|
+
|
|
759
763
|
option.user_count = req.query.user_count ? req.query.user_count : 9;
|
|
760
764
|
option.get_admin = req.query.get_admin ? req.query.get_admin : false;
|
|
761
765
|
option.get_business = req.query.get_business ? req.query.get_business : false;
|
|
762
|
-
option.get_faq = req.query.get_faq ? req.query.get_faq : false;
|
|
763
766
|
option.get_template = req.query.get_template ? req.query.get_template : false;
|
|
764
767
|
option.get_page = req.query.get_page ? req.query.get_page : false;
|
|
765
768
|
option.get_team = req.query.get_team ? req.query.get_team : false;
|
|
766
769
|
|
|
767
|
-
|
|
768
770
|
return option;
|
|
769
771
|
}
|
|
770
772
|
|
|
@@ -1031,7 +1033,7 @@ class Faq_Logic {
|
|
|
1031
1033
|
option = Field_Logic.get_option(DataType.FAQ,option?option:{});
|
|
1032
1034
|
option.get_value = false;
|
|
1033
1035
|
let faq = DataItem.get_new(DataType.FAQ,0,Field_Logic.get_test(title,option));
|
|
1034
|
-
for(let a=0;a<option.question_count+1;a++){
|
|
1036
|
+
for(let a=0;a<parseInt(option.question_count)+1;a++){
|
|
1035
1037
|
if(!option.get_blank){
|
|
1036
1038
|
let question_title = "FAQ Question " + String(parseInt(a+1));
|
|
1037
1039
|
let answer = "My answer "+ Num.get_id() + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
|
|
@@ -1054,7 +1056,7 @@ class Faq_Logic {
|
|
|
1054
1056
|
}
|
|
1055
1057
|
return item_list;
|
|
1056
1058
|
}
|
|
1057
|
-
static
|
|
1059
|
+
static get_faq_question_list_old(faq){
|
|
1058
1060
|
let item_list = [];
|
|
1059
1061
|
for(let a=0;a<19;a++){
|
|
1060
1062
|
let row = a + 1;
|
|
@@ -1454,6 +1456,12 @@ class Favorite_Url {
|
|
|
1454
1456
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1455
1457
|
};
|
|
1456
1458
|
}
|
|
1459
|
+
class Faq_Url {
|
|
1460
|
+
static get = (biz9_config,key,params) => {
|
|
1461
|
+
let action_url="faq/get/"+key;
|
|
1462
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1457
1465
|
class Category_Url {
|
|
1458
1466
|
static get = (biz9_config,key,params) => {
|
|
1459
1467
|
let action_url="category/get/"+key;
|
|
@@ -2039,6 +2047,7 @@ module.exports = {
|
|
|
2039
2047
|
Field_Logic,
|
|
2040
2048
|
FieldType,
|
|
2041
2049
|
Faq_Logic,
|
|
2050
|
+
Faq_Url,
|
|
2042
2051
|
Favorite_Logic,
|
|
2043
2052
|
Favorite_Url,
|
|
2044
2053
|
Gallery_Url,
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const series = require('async-series');
|
|
3
|
-
const {DataItem,DataType,Url,Obj,BiZ_Url,Cat,Stock,Schedule,Storage,Business,Product,Service,Event,Template,Page,Category,Review,Blog_Post,Faq_Logic,Category_Url,Blank_Url,Blank_Logic,Item_Logic,Service_Logic,Template_Logic,Page_Logic,Product_Logic,Event_Logic,Blog_Post_Logic,Content_Logic,Category_Logic,Team_Logic,Business_Logic,PageType,Sub_Item_Logic,Page_Url,Review_Logic,User_Logic,Field_Logic,Order_Logic,Cart_Logic} = require('./index');
|
|
3
|
+
const {DataItem,DataType,Url,Obj,BiZ_Url,Cat,Stock,Schedule,Storage,Business,Product,Service,Event,Template,Page,Category,Review,Blog_Post,Faq_Logic,Category_Url,Blank_Url,Blank_Logic,Item_Logic,Service_Logic,Template_Logic,Page_Logic,Product_Logic,Event_Logic,Blog_Post_Logic,Content_Logic,Category_Logic,Team_Logic,Business_Logic,PageType,Sub_Item_Logic,Page_Url,Review_Logic,User_Logic,Field_Logic,Order_Logic,Cart_Logic,Faq_Url} = require('./index');
|
|
4
4
|
const {Log,Num} = require('biz9-utility');
|
|
5
5
|
const {Scriptz}= require('biz9-scriptz');
|
|
6
6
|
|
|
@@ -153,8 +153,8 @@ describe("connect", () => {
|
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
/* --CONTENT--START */
|
|
156
|
-
let item_list = Content_Logic.get_test_list({content_count:6,get_item:false,get_value:false,get_blank:true});
|
|
157
|
-
Log.w('content_list',item_list);
|
|
156
|
+
//let item_list = Content_Logic.get_test_list({content_count:6,get_item:false,get_value:false,get_blank:true});
|
|
157
|
+
//Log.w('content_list',item_list);
|
|
158
158
|
//let content = Content_Logic.get_test("cool 1");
|
|
159
159
|
//let content = Content_Logic.get_test("Content 1",{get_value:true,get_item:true})
|
|
160
160
|
//Log.w("content",content);
|
|
@@ -345,9 +345,10 @@ describe("connect", () => {
|
|
|
345
345
|
|
|
346
346
|
|
|
347
347
|
/* --FAQ--START */
|
|
348
|
+
Log.w('faq',Faq_Url.get(biz9_config,'primary'));
|
|
348
349
|
//Log.w("FAQ",Faq_Logic.get_test());
|
|
349
|
-
//Log.w("FAQ List",Faq_Logic.get_test_list(Faq_Logic.get_test()));
|
|
350
|
-
//let faq = Faq_Logic.get_test();
|
|
350
|
+
//Log.w("FAQ List",Faq_Logic.get_test_list(Faq_Logic.get_test({question_count:3})));
|
|
351
|
+
//let faq = Faq_Logic.get_test('Cool Quest',{question_count:2});
|
|
351
352
|
//let faq = Faq_Logic.get_test('cool 1');
|
|
352
353
|
//let faq = Faq_Logic.get_test('cool 1',{count:33});
|
|
353
354
|
//let faq = Business_Logic.get_test('ser 1',{question_count:33});
|