Forráskód Böngészése

1. 增加文档
2. 修改后台商品管理简化处理幸运2021
3. 添加一些注释

joe 4 éve
szülő
commit
3dfadee5be

+ 36 - 1
app/admin/controller/store/StoreProduct.php

@@ -331,6 +331,17 @@ class StoreProduct extends AuthController
                 ];
                 $detail[0]['value1'] = '规格';
                 $detail[0]['detail'] = ['规格' => '默认'];
+            } else {
+                if ($cate_id[0] == Config::get('activity.lucky_cate_id')) {
+                    $attr[] = [
+                        'value' => '幸运',
+                        'detailValue' => '',
+                        'attrHidden' => '',
+                        'detail' => [
+                            20, 21
+                        ],
+                    ];
+                }
             }
 
             $attr_res = StoreProductAttr::createProductAttr($attr, $detail, $id);
@@ -363,6 +374,17 @@ class StoreProduct extends AuthController
                 ];
                 $detail[0]['value1'] = '规格';
                 $detail[0]['detail'] = ['规格' => '默认'];
+            } else {
+                if ($cate_id[0] == Config::get('activity.lucky_cate_id')) {
+                    $attr[] = [
+                        'value' => '幸运',
+                        'detailValue' => '',
+                        'attrHidden' => '',
+                        'detail' => [
+                            20, 21
+                        ],
+                    ];
+                }
             }
             $attr_res = StoreProductAttr::createProductAttr($attr, $detail, $res['id']);
             if ($attr_res) {
@@ -508,12 +530,25 @@ class StoreProduct extends AuthController
      * 生成属性
      * @param int $id
      */
-    public function is_format_attr($id = 0, $type = 0)
+    public function is_format_attr($id = 0, $cate_id= 0, $type = 0)
     {
         $data = Util::postMore([
             ['attrs', []],
             ['items', []]
         ]);
+        if (is_array($cate_id)) {
+            return Json::fail('产品只能属于一个分类');
+        }
+        if ($cate_id == Config::get('activity.lucky_cate_id')) {
+            $data['attrs'][] = [
+                'value' => '幸运',
+                'detailValue' => '',
+                'attrHidden' => '',
+                'detail' => [
+                    20, 21
+                ],
+            ];
+        }
         $attr = $data['attrs'];
         $value = attr_format($attr)[1];
         $valueNew = [];

+ 3 - 0
app/admin/controller/user/User.php

@@ -128,6 +128,9 @@ class User extends AuthController
         return $this->fetch('public/form-builder');
     }
 
+    /**
+     * 修改积分/余额
+     */
     public function update_other($uid = 0)
     {
         $data = Util::postMore([

+ 10 - 9
app/admin/view/store/store_product/create.php

@@ -1437,7 +1437,8 @@
             },
             generate: function (type = 0) {
                 var that = this;
-                this.requestPost(that.U({c:"store.StoreProduct",a:'is_format_attr',p:{id:that.id,type:type}}), {attrs:this.formData.items}).then(function (res) {
+                var cate_id = $('input[name="cate_id"]').val()
+                this.requestPost(that.U({c:"store.StoreProduct",a:'is_format_attr',p:{id:that.id, cate_id:cate_id, type:type}}), {attrs:this.formData.items}).then(function (res) {
                     that.$set(that.formData, 'attrs', res.data.value);
                     that.$set(that, 'formHeader', res.data.header);
                     if (that.id && that.formData.is_sub == 1 && that.formData.spec_type == 1) {
@@ -1512,14 +1513,14 @@
                     };
                     that.formData.attrs = [attr];
                 } else {
-                    if(is_lucky && !that.formData.items.find(function(val) {
-                        if (val.value == '幸运' && val.detail.length == 2 &&
-                            val.detail[0] == '20' && val.detail[1] == '21') {
-                            return true;
-                        }
-                    })) {
-                        return that.showMsg('缺少[幸运]规格或格式不正确');
-                    }
+                    // if(is_lucky && !that.formData.items.find(function(val) {
+                    //     if (val.value == '幸运' && val.detail.length == 2 &&
+                    //         val.detail[0] == '20' && val.detail[1] == '21') {
+                    //         return true;
+                    //     }
+                    // })) {
+                    //     return that.showMsg('缺少[幸运]规格或格式不正确');
+                    // }
 
                     if(!is_lucky && that.formData.items.find(function(val) {
                         if (val.value == '幸运') {

+ 13 - 0
app/common.php

@@ -534,4 +534,17 @@ if (!function_exists('ts_of_day')) {
         $tm = localtime($timestamp, true);
         return $timestamp - $tm['tm_hour'] * 60 * 60 - $tm['tm_min'] * 60 - $tm['tm_sec'];
     }
+}
+
+if (!function_exists('mapped_implode')) {
+    function mapped_implode($glue, $array, $symbol = '=') {
+        return implode($glue, array_map(
+                function($k, $v) use($symbol) {
+                    return $k . $symbol . $v;
+                },
+                array_keys($array),
+                array_values($array)
+                )
+            );
+    }
 }

+ 33 - 1
docs/TODO

@@ -26,6 +26,28 @@
     - 注册送 3 元, 发消息
     - 首次消费发消息-提示挖矿
 
+## 已有事件
+    - OrderPaySuccess
+    - UserOrderRemoved
+    - UserOrderTake 确认收货
+    - AdminNewPush 提现申请,评论等
+    - RechargeSuccess 充值成功
+    - ImportNowMoney 导入佣金到余额
+    - StoreProductOrderDeliveryAfter 线下送货
+    - StoreProductOrderDeliveryGoodsAfter 快递发货
+    - StoreProductOrderDistributionAfter 修改发货信息
+    - StoreProductOrderRefundNAfter 不退款
+
+    - ShortMssageSend 发消息
+
+## 新增事件
+    - UserRequestWithdrawal 用户申请佣金提现
+    - UserRegistered    用户注册
+    - UserFirstOrder  首单
+    - UserLevelUp  升级
+    - UserActivity 参加活动
+    
+
 # 扫描脚本,定期扫描系统不正常的地方。
 
 # __后台 title 和 favicon 更换__
@@ -40,7 +62,7 @@
 
 # install 过程增加检查 iconv 模块。
 
-# 整理官网
+# __整理官网__
 
 # 优化支付
 
@@ -50,3 +72,13 @@
 
 # 活动退款用户直接退款到微信,赔款到佣金。 提现页面标记
     “单次体现100元以上可奖励,每提现100奖1元,不足部分忽略。比如:单次体现180 奖励1元得181;单次提现200元,奖2元,到帐202”
+
+# 支持 wukongd 全文搜索
+
+# 整理 API 文档
+
+#  Flutter 客户端
+
+## update:
+
+- ALTER TABLE twong.eb_system_admin ADD secret varchar(100) NULL COMMENT '2FA secret';

+ 1 - 1
docs/事件机制/events.md

@@ -9,4 +9,4 @@
 提示成为会员
 
 - 首次佣金
-消息提示
+消息提示 

+ 1 - 0
public/install/crmeb.sql

@@ -6342,6 +6342,7 @@ CREATE TABLE IF NOT EXISTS `eb_system_admin` (
   `level` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '后台管理员级别',
   `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '后台管理员状态 1有效0无效',
   `is_del` tinyint(1) unsigned NOT NULL DEFAULT '0',
+  `secret` varchar(100) NULL COMMENT '2FA secret',
   PRIMARY KEY (`id`) USING BTREE,
   KEY `account` (`account`) USING BTREE,
   KEY `status` (`status`) USING BTREE

+ 10 - 10
route/api/route.php

@@ -30,10 +30,10 @@ Route::post('register/reset', 'AuthController/reset')->name('registerReset')
 /**
  * 排行榜 api
  */
-Route::get('boards', 'board.UserBoardController/boards')->name('board');
+Route::get('boards', 'board.UserBoardController/boards')->name('board'); // 排行榜榜单
 
 // 模拟推送 (不需要登录)
-Route::get('notifications', 'AuthController/notifications')->name('notifications');
+Route::get('notifications', 'AuthController/notifications')->name('notifications'); // 获取通知
 
 Route::any('wechat/serve', 'wechat.WechatController/serve');//公众号服务
 Route::any('wechat/notify', 'wechat.WechatController/notify');//公众号支付回调
@@ -173,18 +173,18 @@ Route::group(function () {
     /**
      * 消息类 api, 需要权限, 暂时为测试
      */
-    Route::get('user/messages', 'user.UserNoticeController/messages')->name('userMessages');
-    Route::post('user/messages', 'user.UserNoticeController/read')->name('userRead');
-    Route::post('user/messages/del', 'user.UserNoticeController/del')->name('userDel');
+    Route::get('user/messages', 'user.UserNoticeController/messages')->name('userMessages'); // 消息列表
+    Route::post('user/messages', 'user.UserNoticeController/read')->name('userRead'); // 标记已读
+    Route::post('user/messages/del', 'user.UserNoticeController/del')->name('userDel');//删除消息
     
     /**
      * 挖矿类 api
      */
-    Route::get('coin/status', 'coin.UserCoinController/status')->name('coinStatus');
-    Route::post('coin/boot', 'coin.UserCoinController/boot')->name('coinBoot');
-    Route::get('coin/history', 'coin.UserCoinController/history')->name('coinHistory');
-    Route::post('coin/addr', 'coin.UserCoinController/updateAddr')->name('coinUpdateAddr');
-    Route::post('coin/transfer', 'coin.UserCoinController/transfer')->name('coinTransfer');
+    Route::get('coin/status', 'coin.UserCoinController/status')->name('coinStatus'); //同步进度
+    Route::post('coin/boot', 'coin.UserCoinController/boot')->name('coinBoot'); //启动挖矿
+    Route::get('coin/history', 'coin.UserCoinController/history')->name('coinHistory'); //挖矿记录
+    Route::post('coin/addr', 'coin.UserCoinController/updateAddr')->name('coinUpdateAddr'); //更新提币地址
+    Route::post('coin/transfer', 'coin.UserCoinController/transfer')->name('coinTransfer'); //申请提币
 })->middleware(\app\http\middleware\AllowOriginMiddleware::class)->middleware(\app\http\middleware\AuthTokenMiddleware::class, true);
 //未授权接口
 Route::group(function () {

+ 1 - 1
view/H5/.env

@@ -1,3 +1,3 @@
 VUE_APP_API_URL=
 VUE_APP_WS_URL=
-VUE_APP_NAME=crmeb商城
+VUE_APP_NAME=美天旺

+ 1 - 1
view/H5/.env.production

@@ -1,3 +1,3 @@
 VUE_APP_API_URL=
 VUE_APP_WS_URL=
-VUE_APP_NAME=CRMEB
+VUE_APP_NAME=美天旺