Pārlūkot izejas kodu

统计数据,提现限制,资金账单头部

lizhen_gitee 1 gadu atpakaļ
vecāks
revīzija
4d4cb6a7e7

+ 12 - 0
application/api/controller/company/Index.php

@@ -57,6 +57,18 @@ class Index extends Apic
         return $list;
     }
 
+    //资金账单,用来显示本门店下所有用户的储值卡的流水日志
+    public function usermoney_info(){
+        $usernumber = Db::name('user_wallet')->where('company_id',$this->auth->company_id)->count();
+        $summoney = Db::name('user_wallet')->where('company_id',$this->auth->company_id)->sum('money');
+
+        $rs = [
+            'usernumber' => $usernumber,
+            'summoney' => $summoney,
+        ];
+        return $this->success(1,$rs);
+    }
+
 
 
 }

+ 3 - 0
application/api/controller/company/Takecash.php

@@ -68,6 +68,9 @@ class Takecash extends Apic
         }
 
         $bank_info = Db::name('company_bank')->where('company_id',$this->auth->company_id)->find();
+        if(empty($bank_info)){
+            $this->error('请先设置银行卡');
+        }
 
         //
         $real_money = bcdiv(bcmul($money,bcsub(100,$withdrawal_service_fee,2),2),100,2);

+ 28 - 0
application/common/library/Authcompany.php

@@ -353,6 +353,34 @@ class Authcompany
         ];
         $userinfo['today_newpre'] = Db::name('pre_order')->where($map)->count();
 
+        //待处理订单数量
+        $map = [
+            'company_id' => $this->company_id,
+            'status'     => 2,
+        ];
+        $userinfo['order_unfinish'] = Db::name('order')->where($map)->count();
+
+        //昨日订单数量
+        $starttime = strtotime(date('Y-m-d')) - 86400;
+        $endtime = strtotime(date('Y-m-d')) - 1;
+        $map = [
+            'company_id' => $this->company_id,
+            'status'     => 3,
+            'finish_time'=> ['BETWEEN',[$starttime,$endtime]],
+        ];
+        $userinfo['order_zuori'] = Db::name('order')->where($map)->count();
+
+        //7日订单数量
+        $starttime = strtotime(date('Y-m-d')) - 86400*6;
+        $endtime   = strtotime(date('Y-m-d')) + 86399;
+        $map = [
+            'company_id' => $this->company_id,
+            'status'     => 3,
+            'finish_time'=> ['BETWEEN',[$starttime,$endtime]],
+        ];
+        $userinfo['order_qiri'] = Db::name('order')->where($map)->count();
+
+
         return $userinfo;
     }