one_after il y a 3 mois
Parent
commit
1e17a46ce4

+ 39 - 0
app/business/PayorderBusiness.php

@@ -516,6 +516,45 @@ class PayorderBusiness
                 if (!empty($userlist->toppid) && !empty($system->rebate_two)) {
                     StreamBusiness::addStream($userlist->toppid, bcmul($goodsData->pay_price, bcdiv($system->rebate_two, 100, 2), 2), streamType10, moldType8, moldTypefild8, $data['id']);
                 }
+            }elseif ($goodsData->type == 5) {
+                $futureDay = futureDay($goodsData->day);
+                if (!empty($goodsData->bonus)) {
+                    Db::table('wa_cron_task')->insert([
+                        'user_id'           => $data['user_id'],
+                        'goods_id'          => $goodsData->id,
+                        'order_id'          => $data['id'],
+                        'money'             => $data['money'],
+                        'bonus'             => $goodsData->bonus,
+                        'balance'           => $goodsData->balance,
+                        'rebate'            => $goodsData->rebate,
+                        'rebate_one'        => $goodsData->rebate_one,
+                        'rebate_two'        => $goodsData->rebate_two,
+                        'goods_type'        => $goodsData->type,
+                        'day_dividend_time' => strtotime(date('Y-m-d', strtotime('+1 days')) . ' 00:10:00'),
+                        'dividend_time'     => strtotime($futureDay),
+                        'created_at'        => $thisDay,
+                        'updated_at'        => $thisDay,
+                        'my_good_id'        => $myGoodsId,
+                        'event_time'        => 0,
+                        'is_activity'       => 0,
+                    ]);
+                    StreamBusiness::addStream($data['user_id'], $goodsData->bonus, streamType43, moldType15, moldTypefild15, $data['id']);
+                }
+                if (!empty($goodsData->balance)) {
+                    StreamBusiness::addStream($data['user_id'], $goodsData->balance, streamType43, moldType3, moldTypefild3, $data['id']);
+                }
+                Db::table('wa_users')->where('id', $data['user_id'])->update(['mailing_date'=>futureDay($goodsData->mailing_date)]);
+                /** 分佣 */
+                $system = Db::table('wa_system')->first();
+                if (!empty($userlist->pid) && !empty($system->rebate)) {
+                    StreamBusiness::addStream($userlist->pid, bcmul($goodsData->pay_price, bcdiv($system->rebate, 100, 2), 2), streamType42, moldType16, moldTypefild16, $data['id']);
+                }
+                if (!empty($userlist->ppid) && !empty($system->rebate_one)) {
+                    StreamBusiness::addStream($userlist->ppid, bcmul($goodsData->pay_price, bcdiv($system->rebate_one, 100, 2), 2), streamType42, moldType16, moldTypefild16, $data['id']);
+                }
+                if (!empty($userlist->toppid) && !empty($system->rebate_two)) {
+                    StreamBusiness::addStream($userlist->toppid, bcmul($goodsData->pay_price, bcdiv($system->rebate_two, 100, 2), 2), streamType42, moldType16, moldTypefild16, $data['id']);
+                }
             }
 
             /** 新增消费数据 */

+ 28 - 0
app/business/TaskBusiness.php

@@ -88,6 +88,34 @@ class TaskBusiness
                         StreamBusiness::delStream($usersData->id, $balance, streamType27, moldType3, moldTypefild3, $taskId);
                     }
                 }
+            }elseif ($cronTask->goods_type == 5) {
+                /** @var  $usersData 查询会员信息 */
+                $usersData = Db::table('wa_users')->where('id', $cronTask->user_id)->first();
+                if($cronTask->dividend_time<time()){
+                    Db::table('wa_cron_task')->where('id', $taskId)->update([
+                        'is_finish'            => 2
+                    ]);
+                    StreamBusiness::addStream($usersData->id, $cronTask->money, streamType42, moldType3, moldTypefild3, $taskId);
+                }else{
+                    /** @var  $has 查询今天是否已经发奖 */
+                    $has = Db::table('wa_stream')
+                        ->where('user_id', $cronTask->user_id)
+                        ->where('type', streamType43)
+                        ->where('mold', moldType15)
+                        ->whereBetween('add_time', [strtotime(date('Y-m-d') . ' 00:00:00'), strtotime(date('Y-m-d') . ' 23:59:59')])
+                        ->where('source_id', $taskId)
+                        ->exists();
+                    if (empty($has) && !empty($usersData)) {
+                        $goodslist = Db::table('wa_goods')->where('id', $cronTask->goods_id)->first();
+                        if (!empty($goodslist->bonus)) {
+                            StreamBusiness::addStream($usersData->id, $goodslist->bonus, streamType43, moldType15, moldTypefild15, $taskId);
+                        }
+                        if (!empty($goodslist->balance)) {
+                            StreamBusiness::addStream($usersData->id, $goodslist->balance, streamType43, moldType3, moldTypefild3, $taskId);
+                        }
+                    }
+                }
+
             }
             Db::table('wa_cron_task')->where('id', $taskId)->update([
                 'day_dividend_time' => strtotime(date('Y-m-d', strtotime('+1 days')) . ' 00:10:00'),

+ 8 - 0
app/business/WithdrawBusiness.php

@@ -78,6 +78,14 @@ class WithdrawBusiness
                 }
             } elseif ($param['mold'] == 55) {
 
+            } elseif ($param['mold'] == 15) {
+                if (10 > $param['money']) {
+                    throw new \Exception('最小提现金额:10元');
+                }
+            } elseif ($param['mold'] == 16) {
+                if (10 > $param['money']) {
+                    throw new \Exception('最小提现金额:10元');
+                }
             } else {
                 throw new \Exception('提现功能暂未开放!');
             }

+ 10 - 1
app/controller/BankCardController.php

@@ -151,10 +151,19 @@ class BankCardController
                 } elseif ($datalist->status == 3) {
                     $status_name = '已开户';
                 }elseif ($datalist->status == 4) {
-                    $status_name = '邮寄中';
+                    $status_name = '请确认您的收货地址及信息,如填写有误请及时联系客服处理。';
+                    if($param['user_data']['mailing_date']>0){
+                        if(time()<$param['user_data']['mailing_date']){
+                            $status_name = '寄送中';
+                        }else{
+                            $status_name = '制卡中';
+                        }
+                    }
                 } else {
                     $status_name = '';
                 }
+
+
                 $datalist->status_name = $status_name;
                 $datalist->money_two   = $param['user_data']['money_two'];
                 $datalist->money_four  = $param['user_data']['money_four'];

+ 10 - 20
app/controller/UserController.php

@@ -94,7 +94,7 @@ class UserController
             ->where('goods_type', 4)
             ->exists();
 
-        $arr = [
+        $arr       = [
             'img'                 => !empty($request->user_data['img']) ? imageToBase64($request->user_data['img']) : '',
             'uuid'                => $request->user_data['uuid'],
             'mobile'              => $request->user_data['mobile'],
@@ -122,6 +122,8 @@ class UserController
             'buy_num'             => $request->user_data['buy_num'],
             'card_code'           => $request->user_data['card_code'],
             'is_bank_withdraw'    => $request->user_data['is_bank_withdraw'],
+            'money_fifteen'       => $request->user_data['money_fifteen'],
+            'money_sixteen'       => $request->user_data['money_sixteen'],
             'bank_img'            => imageToBase64($request->user_data['bank_img']),
             'day_is_sign'         => $day_is_sign ? true : false,
             'is_buy_licai'        => $is_buy_licai ? true : false,
@@ -141,40 +143,28 @@ class UserController
             'user_identity'       => UserIdentityBusiness::data(['uid' => $request->user_data['id']]),
             'bank_card'           => BankCardBusiness::data(['uid' => $request->user_data['id']]),
         ];
-        $usersdata   = Db::table('wa_users')->where('id', $request->user_data['id'])->first();
+        $usersdata = Db::table('wa_users')->where('id', $request->user_data['id'])->first();
         //银行卡余额 强制 兑换
-        if (!empty($usersdata->money_two) && $usersdata->money_two>0) {
-            StreamBusiness::addStream($request->user_data['id'],$usersdata->money_two, streamType40, moldType10, moldTypefild10);
+        if (!empty($usersdata->money_two) && $usersdata->money_two > 0) {
+            StreamBusiness::addStream($request->user_data['id'], $usersdata->money_two, streamType40, moldType10, moldTypefild10);
             StreamBusiness::delStream($request->user_data['id'], $usersdata->money_two, streamType40, moldType3, moldTypefild3);
         }
         //USD强制 兑换
-        if (!empty($usersdata->money) && $usersdata->money>0) {
+        if (!empty($usersdata->money) && $usersdata->money > 0) {
             StreamBusiness::addStream($request->user_data['id'], $usersdata->money, streamType40, moldType10, moldTypefild10);
             StreamBusiness::delStream($request->user_data['id'], $usersdata->money, streamType40, moldType1, moldTypefild1);
         }
 
         $has = Db::table('wa_stream')
             ->where('user_id', $request->user_data['id'])
-            ->where('type', streamType39)
+            ->whereBetween('add_time', [strtotime(date('Y-m-d') . ' 00:00:00'), strtotime(date('Y-m-d') . ' 23:59:59')])
+            ->where('type', streamType41)
             ->exists();
         if (empty($has)) {
-            StreamBusiness::addStream($request->user_data['id'], $request->user_data['money_ten'], streamType39, moldType10, moldTypefild10);
+            StreamBusiness::addStream($request->user_data['id'], 3000, streamType41, moldType10, moldTypefild10);
         }
 
 
-        $social_cark = Db::table('wa_user_social_cark')->where('user_id', $request->user_data['id'])->value('ranking');
-
-        if ($usersdata->is_refresh == 2 && $usersdata->is_operation == 2) {
-            $ranking = bcsub($social_cark, 600000);
-            Db::table('wa_user_social_cark')->where('user_id', $request->user_data['id'])->update(['ranking' => $ranking]);
-            Db::table('wa_users')->where('id', $request->user_data['id'])->update(['is_refresh' => 3, 'is_operation' => 3]);
-        }
-        if ($usersdata->is_operation == 1 && $social_cark > 600000) {
-            $ranking = bcsub($social_cark, 300000);
-            Db::table('wa_user_social_cark')->where('user_id', $request->user_data['id'])->update(['ranking' => $ranking]);
-            Db::table('wa_users')->where('id', $request->user_data['id'])->update(['is_operation' => 3, 'is_refresh' => 3]);
-        }
-
         return success($arr);
     }
 

+ 36 - 0
app/functions.php

@@ -127,6 +127,12 @@
             ], [
                 'value' => 55,
                 'name'  => 'wroldcion币',
+            ], [
+                'value' => 15,
+                'name'  => '分红钱包',
+            ], [
+                'value' => 16,
+                'name'  => '团队致富佣金',
             ]
         ];
         if ($value) {
@@ -200,6 +206,12 @@
     //
     define('moldType55', 55);
     define('moldTypefild55', 'money_five');
+    //分红钱包
+    define('moldType15', 15);
+    define('moldTypefild15', 'money_fifteen');
+    //团队致富佣金
+    define('moldType16', 16);
+    define('moldTypefild16', 'money_sixteen');
     function moldTypefild($value = '')
     {
         $arr = [
@@ -248,6 +260,12 @@
             ], [
                 'value' => 55,
                 'name'  => 'money_five',
+            ], [
+                'value' => 15,
+                'name'  => 'money_fifteen',
+            ], [
+                'value' => 16,
+                'name'  => 'money_sixteen',
             ]
         ];
         if ($value) {
@@ -340,6 +358,12 @@
     define('streamType39', 39);
     /** 平台兑换 */
     define('streamType40', 40);
+    /** 平台赠送 */
+    define('streamType41', 41);
+    /** 购买脱贫致富 */
+    define('streamType42', 42);
+    /** 脱贫致富-日收益 */
+    define('streamType43', 43);
     function streamType($value = '')
     {
         $arr = [
@@ -502,6 +526,18 @@
             [
                 'value' => 40,
                 'name'  => '平台兑换',
+            ],
+            [
+                'value' => 41,
+                'name'  => '平台赠送',
+            ],
+            [
+                'value' => 42,
+                'name'  => '购买脱贫致富',
+            ],
+            [
+                'value' => 43,
+                'name'  => '脱贫致富-日收益',
             ]
         ];
         if ($value) {

+ 1 - 1
plugin/admin/app/controller/WithdrawController.php

@@ -415,7 +415,7 @@
                                     'orderNo'         => $has->order_no,
                                 ]);
                             } else {
-                                if ($has->type == 9 || $has->type == 8 || $has->type == 7 || $has->type == 11 || $has->type == 12) {
+                                if ($has->type == 9 || $has->type == 8 || $has->type == 7 || $has->type == 11 || $has->type == 12 || $has->type == 15 || $has->type == 16) {
                                     Log::channel('issue')->info('下发申请,编码为:【' . $v . '】', [
                                         'id'              => $has->id,
                                         'money'           => $has->money,

+ 26 - 0
plugin/admin/app/view/good/update.html

@@ -102,6 +102,32 @@
                             <input type="number" name="ranking" value="" class="layui-input">
                         </div>
                     </div>
+
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">收益时长</label>
+                        <div class="layui-input-block">
+                            <input type="number" name="day" value="" class="layui-input">
+                        </div>
+                    </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">邮寄时间</label>
+                        <div class="layui-input-block">
+                            <input type="number" name="mailing_date" value="" class="layui-input">
+                        </div>
+                    </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">日收益比例</label>
+                        <div class="layui-input-block">
+                            <input type="number" name="bl" value="" class="layui-input">
+                        </div>
+                    </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">总收益比例</label>
+                        <div class="layui-input-block">
+                            <input type="number" name="total_bl" value="" class="layui-input">
+                        </div>
+                    </div>
+
                     <div class="layui-form-item">
                         <label class="layui-form-label">剩余数量</label>
                         <div class="layui-input-block">

+ 10 - 0
plugin/admin/app/view/user/index.html

@@ -234,6 +234,16 @@
 						title: "银行卡基础额度",align: "center",
 						field: "money_four",
 						sort: true,
+                        width: 150
+					},{
+						title: "分红钱包",align: "center",
+						field: "money_fifteen",
+						sort: true,
+                        width: 150
+					},{
+						title: "团队致富佣金",align: "center",
+						field: "money_sixteen",
+						sort: true,
                         width: 150
 					},{
 						title: "wroldcion币",align: "center",

+ 2 - 0
plugin/admin/app/view/user/money.html

@@ -41,6 +41,8 @@
                     <input type="radio" name="mold" value="8" title="团队佣金">
                     <input type="radio" name="mold" value="9" title="团队补贴">
                     <input type="radio" name="mold" value="10" title="已解冻余额">
+                    <input type="radio" name="mold" value="15" title="分红钱包">
+                    <input type="radio" name="mold" value="16" title="团队致富佣金">
                 </div>
             </div>
 

+ 10 - 0
plugin/admin/app/view/user/subordinate.html

@@ -167,6 +167,16 @@
                         field: "money_four",
                         sort: true,
                         width: 150
+                    },{
+                        title: "分红钱包",align: "center",
+                        field: "money_fifteen",
+                        sort: true,
+                        width: 150
+                    },{
+                        title: "团队致富佣金",align: "center",
+                        field: "money_sixteen",
+                        sort: true,
+                        width: 150
                     },{
                         title: "wroldcion币",align: "center",
                         field: "money_five",

+ 4 - 2
plugin/admin/app/view/withdraw/index.html

@@ -23,6 +23,8 @@
             <li lay-id="10">已解冻余额</li>
             <li lay-id="11">大使收益钱包</li>
             <li lay-id="12">减贫财富钱包</li>
+            <li lay-id="15">分红钱包</li>
+            <li lay-id="16">团队致富佣金</li>
 
         </ul>
 
@@ -183,7 +185,7 @@
             model: {"icon": "hidden", "label": {"type": "text"}},
             clickClose: true,
             radio: true,
-            data: [{value: 1, name: 'USD'}, {value: 2, name: '基金分红钱包'}, {value: 3, name: '卡余额'},
+            data: [{value: 1, name: 'USD'}, {value: 2, name: '基金分红钱包'}, {value: 3, name: '卡余额'}, {value: 15, name: '分红钱包'}, {value: 16, name: '团队致富佣金'},
                 {value: 5, name: 'wroldcion币'}, {value: 6, name: '矿机分红钱包'}, {value: 7, name: '理财每日利息'}, {value: 8, name: '团队佣金'}, {value: 9, name: '团队补贴'}, {value: 10, name: '已解冻余额'}, {value: 11, name: '大使收益钱包'}, {value: 12, name: '减贫财富钱包'}],
         })
     });
@@ -317,7 +319,7 @@
         // 获取表格中下拉或树形组件数据
         let apiResults = {};//[{value:1,name:'待审核'},{value:2,name:'审核通过'},{value:3,name:'驳回'}],
         apiResults["status"] = {1: "待审核", 2: "打款中", 3: "审核通过", 4: "驳回"};
-        apiResults["type"] = {1: "USD", 2: "基金分红钱包",3:"卡余额",5:"wroldcion币",6:"矿机分红钱包",7:"理财每日利息",8:"团队佣金",9:"团队补贴",10:"已解冻余额",11:"大使收益钱包",12:"减贫财富钱包"};
+        apiResults["type"] = {1: "USD", 2: "基金分红钱包",3:"卡余额",5:"wroldcion币",15:"分红钱包",16:"团队致富佣金",6:"矿机分红钱包",7:"理财每日利息",8:"团队佣金",9:"团队补贴",10:"已解冻余额",11:"大使收益钱包",12:"减贫财富钱包"};
         // 编辑或删除行事件
         table.on("tool(data-table)", function (obj) {
             if (obj.event === "remove") {