biz9-logic 3.5.13 → 3.5.16

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='3.6.3'
1
+ VERSION='3.6.6'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -24,6 +24,7 @@ class DataType {
24
24
  static DT_BLOG_POST='blog_post_biz';
25
25
  static DT_CART_ITEM="cart_item_biz";
26
26
  static DT_CATEGORY='category_biz';
27
+ static DT_CONTENT='content_biz';
27
28
  static DT_EVENT='event_biz';
28
29
  static DT_GALLERY='gallery_biz';
29
30
  static DT_ITEM_MAP='item_map_biz';
@@ -47,6 +48,13 @@ class DataItem {
47
48
  static get_biz = (biz9_config,item,options)=>{
48
49
  return get_biz_item_main(biz9_config,item,options);
49
50
  }
51
+ static get_biz_by_list = (biz9_config,list,options)=>{
52
+ let r_list = [];
53
+ for(let a=0;a<list.length;a++){
54
+ r_list.push(get_biz_item_main(biz9_config,list[a],options));
55
+ }
56
+ return r_list;
57
+ }
50
58
  }
51
59
  class BiZ_Url {
52
60
  static get_item=(biz9_config,data_type,id)=>{
@@ -70,6 +78,10 @@ class Url {
70
78
  let action_url= "main/test/connect/";
71
79
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
72
80
  };
81
+ static upload_file = (biz9_config,data_type,id) => {
82
+ let action_url= "main/crud/update/"+data_type + "/" + id;
83
+ return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
84
+ };
73
85
  static update_item = (biz9_config,data_type,id) => {
74
86
  let action_url= "main/crud/update/"+data_type + "/" + id;
75
87
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
@@ -168,8 +180,9 @@ class CMS {
168
180
  static Tab_Edit_Title_List = 'list';
169
181
  static Tab_Edit_Title_Value = 'value';
170
182
  static Tab_Edit_Title_Setting = 'setting';
183
+ static Tab_Edit_Title_Audio = 'audio';
184
+ static Tab_Edit_Title_Video = 'video';
171
185
  static Tab_Edit_Title_Note = 'note';
172
-
173
186
  static get_new_query_item_by_item = (item) => {
174
187
  return {
175
188
  id: item.id ? item.id : 0,
@@ -228,10 +241,19 @@ class CMS {
228
241
  break;
229
242
  case CMS.Tab_Edit_Title_Setting:
230
243
  return 'Settings';
244
+ break;
231
245
  case CMS.Tab_Edit_Title_Note:
232
246
  return 'Note';
247
+ break;
248
+ case CMS.Tab_Edit_Title_Audio:
249
+ return 'Audio';
250
+ break;
251
+ case CMS.Tab_Edit_Title_Video:
252
+ return 'Video';
253
+ break;
233
254
  default:
234
255
  return 'N/A';
256
+ break;
235
257
  }
236
258
  }
237
259
  static get_page_url = (url,tab_title,item,parent_item,top_item,parms) => {
@@ -253,7 +275,6 @@ class CMS {
253
275
  return url+r_url;
254
276
  }
255
277
  }
256
-
257
278
  module.exports = {
258
279
  DataType,
259
280
  DataItem,
package/main.js CHANGED
@@ -45,8 +45,6 @@ const get_biz_item_main=(biz9_config,item,options) =>{
45
45
  item.discount=parseFloat(0.00);
46
46
  }
47
47
  discount = item.old_cost - item.cost;
48
- console.log('aaaaaaa');
49
- console.log(discount);
50
48
  item.discount= parseInt(((discount / item.old_cost) * 100));
51
49
  if(isNaN(item.discount)){
52
50
  item.discount="0%";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "3.5.13",
3
+ "version": "3.5.16",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -28,7 +28,28 @@ const biz9_config ={
28
28
  describe("connect", () => {
29
29
  it("_connect", () => {
30
30
  series([
31
+ function(call) {
32
+ console.log('SET-ITEM-BIZ-BY-LIST-START');
33
+ let item_test_list = [];
34
+ let item_test = Test.get_item('dt_blank',0);
35
+ item_test.cost = String(Number.get_id())+'.55';
36
+ item_test.old_cost = String(Number.get_id())+'.20';
37
+ item_test.title ='_title_'+Number.get_id();
38
+
39
+ item_test_list.push(item_test);
31
40
 
41
+ let item_test_1 = Test.get_item('dt_blank',0);
42
+ item_test_1.cost = '5.55';
43
+ item_test_1.old_cost = '9.55';
44
+ item_test_1.title ='_title_'+Number.get_id();
45
+
46
+ item_test_list.push(item_test_1);
47
+
48
+ let item_list_biz = DataItem.get_biz_by_list(biz9_config,item_test_list,{get_date:false,get_count:false,get_biz_map:false,get_money:true});
49
+ console.log(item_list_biz);
50
+ console.log('SET-ITEM-BIZ-BY-LIST-SUCCESS');
51
+ //call();
52
+ },
32
53
  function(call) {
33
54
  console.log('SET-ITEM-BIZ-START');
34
55
  let item_test = Test.get_item('dt_blank',0);