浏览代码

Merge remote-tracking branch 'origin/master'

Panda 3 周之前
父节点
当前提交
edfc9a4182

+ 3 - 0
addons/shopro/listener/Order.php

@@ -410,6 +410,9 @@ class Order
 
         // 订单已全部确认收货
         if ($noConfirm <= 0) {
+
+            //在这里加一个已确认收货的时间
+
             $data = ['order' => $order];
 
             \think\Hook::listen('order_confirm_finish', $data);

+ 1 - 1
addons/shopro/service/order/OrderOper.php

@@ -157,7 +157,7 @@ class OrderOper
 
             // 订单确认收货后
             $data = ['order' => $order, 'item' => $item];
-            \think\Hook::listen('order_confirm_after', $data);
+            \think\Hook::listen('order_confirm_after', $data); //orderConfirmAfter
         }
 
         //商城,确认收货,冗余到bill表

+ 26 - 2
application/api/controller/Demo.php

@@ -48,6 +48,16 @@ class Demo extends Api
         $this->task_bill($total_amount,$back_rate,$user_id,$shop_id,'hotel_order');
     }
 
+    //商城订单,确认收货7天后,售后完成后
+    public function shopro_to_bill(){
+        //Db::name('shopro_order')->where('')
+    }
+
+    //高管用户,分红
+    public function commander(){
+
+    }
+
     /**
      * 40期限 数据模拟
      * @return void
@@ -166,7 +176,7 @@ class Demo extends Api
         $invite_count     = Db::name('offline_shop')->where('invite_id',$user_id)->count();
 
         //我上个月直推线下商家的总数量
-        $invite_count_mon = Db::name('offline_shop')->where('invite_id',$user_id)->whereTime('back_time','last month')->count();
+        $invite_count_mon = Db::name('offline_shop')->where('invite_id',$user_id)->whereTime('create_time','last month')->count();
 
         //我的个人业绩。我所有直推线下商家的3-20%的让利总额
         $invite_amount = Db::name('bill')->where('shop_invite_id',$user_id)->where('table_name','offline_shop_order')->where('back_status','neq',0)
@@ -212,7 +222,7 @@ class Demo extends Api
                 }
             }else{
                 //营销员
-                if($invite_amount >= 60000 && $invite_count_mon >= 5){
+                if($invite_amount >= $level['invite_amount'] && $invite_count_mon >= $level['invite_count_mon']){
                     $butie     = $level['butie'];
                     $ticheng_rate = $level['ticheng_rate'];
 
@@ -458,4 +468,18 @@ class Demo extends Api
         Db::name('live_room_log')->where('id',23)->update($data);
     }
 
+    public function test4(){
+        $password = '123456';
+        $salt = 'xPpXeK';
+        dd(md5(md5($password) . $salt));
+
+        $a = ['first Day of last month 00:00:00', 'first Day of this month 00:00:00'];
+        echo date('Y-m-d H:i:s',strtotime($a[0]));
+        echo  '<br>';
+        echo date('Y-m-d H:i:s',strtotime($a[1]));
+
+        $last_month_arr = [strtotime('first Day of last month 00:00:00'),strtotime('first Day of this month 00:00:00')-1];
+        dump($last_month_arr);
+    }
+
 }

+ 19 - 6
application/common/business/ShopWalletBusiness.php

@@ -14,12 +14,25 @@ class ShopWalletBusiness extends BusinessResult
 {
     // 日志变动类型
     const log_type = [
-        1  => '系统调节',//money + -
-        40 => '酒店预定',//money + -
-        50 => '餐厅预定',//money + -
-        60 => '老年大学活动报名',//money + -
-        70 => '线下消费',//money + -
-        80 => '旅游预定',//money + -
+        //balance 商家的经营成本
+        1  => '系统调节',//balance + -
+
+        31 => '商城订单支付', //balance +  //商城的不给维护
+        32 => '商城订单退款', //balance -  //商城的不给维护
+
+        40 => '酒店预定',//balance + -
+        50 => '餐厅预定',//balance + -
+        60 => '老年大学活动报名',//balance + -
+        70 => '线下消费',//balance + -            //线下的用不到,分账了
+        80 => '旅游预定',//balance + -
+
+        //money 40期的收益
+        400 => '40期', //money +
+
+
+        //让利积分
+        201 => '用户来消费', //points +
+        202 => '周期结束释放', //points -
     ];
 
     /**

+ 18 - 6
application/common/model/Wallet.php

@@ -14,28 +14,39 @@ class Wallet extends BaseModel
     const log_type = [
         1  => '系统调节',//money + -
         10  => '用户充值',//money +
-        21 => '商务奖',
-        22 => '锁客奖',
-        23 => '业务员补贴',
-        24 => '业务员个人业绩',
+
+        21 => '商务奖', //money +
+        22 => '锁客奖', //money +
+        23 => '业务员补贴', //money +
+        24 => '业务员个人业绩', //money +
+        28 => '代理奖', //money +
 
         31 => '商城订单支付', //money -
         32 => '商城订单退款', //money +
+
         40 => '酒店预定',//money + -
         50 => '餐厅预定',//money + -
         60 => '老年大学活动报名',//money + -
         70 => '线下消费',//money + -
+        80 => '旅游预定',//money + -
+
+        400 => '40期', //money +
 
         //善豆
         101 => '签到', //bean +
         102 => '完成任务', //bean +
         131 => '商城下单预先抵扣', //bean -
         132 => '商城订单退回', //bean +
+
+        //让利积分
+        201 => '用户消费', //points +
+        202 => '周期结束释放', //points -
     ];
     // 操作钱包余额类型
     const money_type = [
         'money' => '余额',
         'bean' => '善豆',
+        'points' => '让利积分',
     ];
 
     // Bill订单所属日志 type id
@@ -44,6 +55,7 @@ class Wallet extends BaseModel
         'hotel_canteen_order'    => 50,
         'university_event_apply' => 60,
         'offline_shop_order'     => 70,
+        'travel_order'           => 80,
     ];
 
     protected $message = '';
@@ -121,7 +133,7 @@ class Wallet extends BaseModel
 
         //获取小数点
         $point = 0;
-        if(in_array($accountType,['money','bean'])){
+        if(in_array($accountType,['money','bean','points'])){
             $point = 2;
         }
         bcscale($point);
@@ -215,7 +227,7 @@ class Wallet extends BaseModel
     {
         //获取小数点
         $point = 0;
-        if(in_array($accountType,['money','bean'])){
+        if(in_array($accountType,['money','bean','points'])){
             $point = 2;
         }
         bcscale($point);