biz9-logic 4.8.378 → 4.8.381

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='8.5.8'
1
+ VERSION='8.6.1'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -36,6 +36,11 @@ class Message {
36
36
  static REVIEW_USER_LOGIN="Please Login To Add Review.";
37
37
  }
38
38
  class Item_Logic {
39
+ static get_new = (title,data_type,option)=>{
40
+ option = option ? option : {};
41
+ const item = DataItem.get_new(data_type,0,{title:title,title_url:Str.get_title_url(title),setting_visible:"1"});
42
+ return item;
43
+ };
39
44
  static get_test = (title,data_type,id,option)=>{
40
45
  data_type = data_type ? data_type : DataType.BLANK;
41
46
  id = id ? id : 0;
@@ -453,6 +458,33 @@ class Cart_Logic {
453
458
  };
454
459
  }
455
460
  class Product_Logic {
461
+ static get_new_type = (title,option) => {
462
+ option = option ? option : {get_category:false,categorys:''};
463
+ const item = Item_Logic.get_new(title,DataType.TYPE);
464
+ if(option.get_category){
465
+ item.categorys = [];
466
+ let category_title_list = option.categorys.split(',');
467
+ category_title_list.forEach(cat_item => {
468
+ item.categorys.push(Product_Logic.get_new_category(cat_item,item.title,DataType.PRODUCT));
469
+ });
470
+ }
471
+ return item;
472
+ };
473
+ static get_new_category = (title,type,category,option) => {
474
+ option = option ? option : {};
475
+ const item = Item_Logic.get_new(title,DataType.CATEGORY);
476
+ item.type = type;
477
+ item.category = category = category?category:"";
478
+ return item;
479
+ };
480
+ static get_new_product = (title,type,category,option) => {
481
+ option = option ? option : {};
482
+ const item = Item_Logic.get_new(title,DataType.PRODUCT);
483
+ item.type = type;
484
+ item.category = category = category?category:"";
485
+ return item;
486
+ };
487
+
456
488
  static get_stock_list = () => {
457
489
  const r_list=
458
490
  [
@@ -1577,7 +1609,6 @@ class App_Logic {
1577
1609
  app_id:app_id?app_id:null,
1578
1610
  }
1579
1611
  }
1580
-
1581
1612
  }
1582
1613
  class Image_Logic {
1583
1614
  static url_post = (app_id,url,param) => {
@@ -1668,7 +1699,7 @@ class Url {
1668
1699
  static COPY="main/crud/copy";
1669
1700
  static DELETE="main/crud/delete";
1670
1701
  static DELETE_CHECK_PROTECTION="main/crud/delete_item_check_protection";
1671
- static DELETE_LIST="main/crud/delete_list";
1702
+ static DELETE_SEARCH="main/crud/delete_search";
1672
1703
  static GET="main/crud/get";
1673
1704
  static PARENT_TOP="main/crud/parent_top";
1674
1705
  static POST="main/crud/post";
@@ -1718,6 +1749,7 @@ class Url {
1718
1749
  static USER_LOGIN="user/login";
1719
1750
  static USER_LOGOUT="user/logout";
1720
1751
  static USER_REGISTER="user/register";
1752
+ static USER_POST="user/post";
1721
1753
  //stat
1722
1754
  static STAT_SEARCH="item/stat_search";
1723
1755
  //template
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.8.378",
3
+ "version": "4.8.381",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -30,8 +30,7 @@ describe("connect", () => {
30
30
  series([
31
31
  function(call) {
32
32
  console.log('CONNECT-START');
33
- //console.log(Product_Logic.get_test_list());
34
- console.log(Event_Logic.get_test_list());
33
+ console.log(Product_Logic.get_new_type('New Type',{get_category:true,categorys:'Cat1,Cat2,Cat3'}));
35
34
  console.log('CONNECT-END');
36
35
  call();
37
36
  },