biz9-logic 10.0.76 → 10.0.79

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='10.7.7'
1
+ VERSION='10.8.0'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main'
package/index.js CHANGED
@@ -164,18 +164,13 @@ class Type {
164
164
  static TITLE_CART_SUB_ITEMS='Cart Sub Items';
165
165
  static TITLE_CART_ITEMS='Cart Items';
166
166
  static TITLE_CART_SUB_ITEMS='Cart Sub Items';
167
- static TITLE_COUNT='Count';
167
+ static TITLE_IMAGES='Images';
168
168
  static TITLE_GROUP='Group';
169
169
  static TITLE_N_A='N/A';
170
- static TITLE_IMAGES='Images';
171
- static TITLE_ITEMS='Items';
172
- static TITLE_ONE='One';
173
170
  static TITLE_ORDER_ITEMS='Order Items';
174
171
  static TITLE_ORDER_SUB_ITEMS='order Sub Items';
175
172
  static TITLE_PARENT_ITEM='Parent Item';
176
173
  static TITLE_USER='User';
177
- static TITLE_SORT_BY_ASC='asc';
178
- static TITLE_SORT_BY_DESC='desc';
179
174
  static TITLE_STAT_ITEMS='Stat Items';
180
175
  static TITLE_STAT_SUB_ITEMS='Stat Sub Items';
181
176
  static TITLE_ORDER_STATUS_NEW="New";
@@ -238,6 +233,12 @@ class Type {
238
233
  static PAGE_SERVICE='service';
239
234
  static PAGE_SERVICE_HOME='service_home';
240
235
  static PAGE_SERVICE_SEARCH='service_search';
236
+ //search
237
+ static SEARCH_ITEMS='items';
238
+ static SEARCH_ONE='one';
239
+ static SEARCH_COUNT='count';
240
+ static SEARCH_SORT_BY_ASC='asc';
241
+ static SEARCH_SORT_BY_DESC='desc';
241
242
  //stat
242
243
  static STAT_CART='cart_post';
243
244
  static STAT_CART_ITEM='cart_item_post';
@@ -2288,9 +2289,9 @@ class Data_Logic {
2288
2289
  }
2289
2290
  static get_search_group = (option) => {
2290
2291
  option = option ? option : {};
2291
- let type = option.type ? option.type : Type.TITLE_ITEMS;
2292
+ let type = option.type ? option.type : Type.SEARCH_ITEMS;
2292
2293
  let field = option.field ? option.field : {};
2293
- let title = option.title ? option.title : {};
2294
+ let title = option.title ? Str.get_title_url(option.title) : {};
2294
2295
  let image_show = option.image_show ? option.image_show : {};
2295
2296
  let image = option.image ? option.image : {show:false};
2296
2297
  let page_current = option.page_current ? option.page_current : 1;
@@ -2299,25 +2300,27 @@ class Data_Logic {
2299
2300
  }
2300
2301
  static get_search_foreign = (type,foreign_data_type,foreign_field,parent_field,option) => {
2301
2302
  option = option ? option : {};
2302
- type = type ? type : Type.TITLE_ITEMS;
2303
+ type = type ? type : Type.SEARCH_ITEMS;
2303
2304
  foreign_data_type = foreign_data_type ? foreign_data_type : Str.get_title_url(Data_Logic.get_data_type_by_type(foreign_data_type,{plural:true}));
2304
2305
  foreign_field = foreign_field ? foreign_field : Type.FIELD_PARENT_ID;
2305
2306
  parent_field = parent_field ? parent_field : parent_field;
2306
2307
  let field = option.field ? option.field : null;
2307
- let title = option.title ? option.title : Str.get_title_url(Data_Logic.get_data_type_by_type(foreign_data_type,{plural:true}));
2308
+ let title = option.title ? Str.get_title_url(option.title) : Str.get_title_url(Data_Logic.get_data_type_by_type(foreign_data_type,{plural:true}));
2308
2309
  let page_current = option.page_current ? option.page_current : 1;
2309
2310
  let page_size = option.page_size ? option.page_size : 0;
2310
2311
  return {type:type,foreign_data_type:foreign_data_type,foreign_field:foreign_field,parent_field:parent_field,type:type,field:field,title:title,page_current:page_current,page_size:page_size};
2311
2312
  }
2312
2313
  static get_search_join = (type,search,option) => {
2313
2314
  option = option ? option : {};
2314
- type = type ? type : Type.TITLE_ITEMS;
2315
+ type = type ? type : Type.SEARCH_ITEMS;
2315
2316
  search = search ? search : Data_Logic.get_search(Type.DATA_BLANK,{},{},1,0);
2316
2317
  let field = option.field ? option.field : {};
2317
- let title = option.title ? option.title : Str.get_title_url(Data_Logic.get_data_type_by_type(search.data_type,{plural:true}));
2318
- let page_current = option.page_current ? option.page_current : 1;
2318
+ let distinct = option.distinct ? option.distinct : null; //distinct:{field:'title',sort_by:Type.SEARCH_SORT_BY_DESC}
2319
+ let title = option.title ? Str.get_title_url(option.title) : Str.get_title_url(Data_Logic.get_data_type_by_type(search.data_type,{plural:true}));
2320
+ let foreigns = option.foreigns ? option.foreigns : [];
2321
+ let page_current = option.page_current ? option.page_current : 1;
2319
2322
  let page_size = option.page_size ? option.page_size : 0;
2320
- return {type:type,search:search,field:field,title:title,page_current:page_current,page_size:page_size};
2323
+ return {type:type,search:search,field:field,title:title,distinct:distinct,foreigns:foreigns,page_current:page_current,page_size:page_size};
2321
2324
  }
2322
2325
  static copy = (data_type,item)=>{
2323
2326
  let copy_item = Data_Logic.get_new(data_type,0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "10.0.76",
3
+ "version": "10.0.79",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -55,14 +55,20 @@ describe("connect", () => {
55
55
  // -- ORDER START -- //
56
56
  // -- order start //
57
57
  let order = Order_Logic.get(cart,{order_code:'OR'});
58
- Log.w('order',order);
59
- Log.w('order_items',order.order_items[0]);
58
+ //Log.w('order',order);
59
+ //Log.w('order_items',order.order_items[0]);
60
60
  // -- order end //
61
61
  // -- order item start //
62
62
  // -- order item end //
63
63
 
64
64
  // -- ORDER END -- //
65
65
 
66
+ // -- LIST START -- //
67
+ let data_type = Data_Logic.get_data_type_by_type(Type.DATA_PRODUCT,{plural:true});
68
+ Log.w('my_data_type',data_type);
69
+
70
+ // -- LIST END -- //
71
+
66
72
  // -->
67
73
  //let parent = Data_Logic.get_new(Type.DATA_PRODUCT,0);
68
74
  //let parent = Data_Logic.get_new(Type.DATA_PRODUCT,0,{test:true,count:3,blank:false,data:{field_1:'apple'}});