Browse Source

统计信息,字段修改

lizhen_gitee 1 year ago
parent
commit
9f350859b2

+ 1 - 1
application/api/controller/company/Coupon.php

@@ -118,7 +118,7 @@ class Coupon extends Apic
                 'ordertype'  => 3,
                 'ordertype'  => 3,
                 'status'     => 2, //2=已支付,待处理
                 'status'     => 2, //2=已支付,待处理
             ];
             ];
-            $check = Db::name('order')->field('id,package_title as name,package_endtime as endtime,package_price as price')->where($map)->find();
+            $check = Db::name('order')->field('id,server_info as name,package_endtime as endtime,pay_fee as price')->where($map)->find();
             if(!empty($check)){
             if(!empty($check)){
                 $check['getfrom'] = '购买';
                 $check['getfrom'] = '购买';
                 $check['action'] = $action;
                 $check['action'] = $action;

+ 2 - 2
application/api/controller/company/Order.php

@@ -168,7 +168,7 @@ class Order extends Apic
     public function appen_lists(){
     public function appen_lists(){
         $id = input('id',0);
         $id = input('id',0);
 
 
-        $info = Db::name('order')->field('id,orderno,pay_fee,package_price,appen_fee')->where('id',$id)->where('company_id',$this->auth->company_id)->find();
+        $info = Db::name('order')->field('id,orderno,pay_fee,appen_fee')->where('id',$id)->where('company_id',$this->auth->company_id)->find();
         if(!$info){
         if(!$info){
             $this->error('不存在的订单');
             $this->error('不存在的订单');
         }
         }
@@ -183,7 +183,7 @@ class Order extends Apic
         $id = input('id',0);
         $id = input('id',0);
 
 
         Db::startTrans();
         Db::startTrans();
-        $info = Db::name('order')->field('id,orderno,pay_fee,package_price,appen_fee')->where('id',$id)->where('company_id',$this->auth->company_id)->lock(true)->find();
+        $info = Db::name('order')->field('id,orderno,pay_fee,appen_fee')->where('id',$id)->where('company_id',$this->auth->company_id)->lock(true)->find();
         if(!$info){
         if(!$info){
             $this->error('不存在的订单');
             $this->error('不存在的订单');
         }
         }

+ 5 - 3
application/common/library/Authcompany.php

@@ -310,9 +310,11 @@ class Authcompany
 
 
         //追加
         //追加
         $userinfo['company']['image'] = one_domain_image($userinfo['company']['image']);
         $userinfo['company']['image'] = one_domain_image($userinfo['company']['image']);
-        $userinfo['money'] = model('walletcompany')->getWallet($this->company_id,'money');
+        $userinfo['money'] = model('walletcompany')->getWallet($this->company_id,'money'); //可提现金额
+        $userinfo['dongjie_money'] = Db::name('order')->where('company_id',$this->company_id)->where('status',2)->where('ordertype',3)->sum('pay_fee');//冻结金额,即出售的套餐,但没使用的
+        $userinfo['all_money'] = bcadd($userinfo['money'],$userinfo['dongjie_money'],2);
 
 
-/////////////////////////////////////
+        /////////////////////////////////////
         //个人信息
         //个人信息
         $strattime = strtotime(date('Y-m-d'));
         $strattime = strtotime(date('Y-m-d'));
         $endtime   = $strattime + 86399;
         $endtime   = $strattime + 86399;
@@ -322,7 +324,7 @@ class Authcompany
         //今日开单
         //今日开单
         $map = [
         $map = [
             'company_id' => $this->company_id,
             'company_id' => $this->company_id,
-            'finishtime' => ['BETWEEN',[$strattime,$endtime]], //开单时间用完成时间
+            'finish_time' => ['BETWEEN',[$strattime,$endtime]], //开单时间用完成时间
             'status'     => 3,
             'status'     => 3,
         ];
         ];
         if($this->type == 2){
         if($this->type == 2){