|
@@ -66,7 +66,85 @@ class Index extends Apic
|
|
|
'usernumber' => $usernumber,
|
|
|
'summoney' => $summoney,
|
|
|
];
|
|
|
- return $this->success(1,$rs);
|
|
|
+ $this->success(1,$rs);
|
|
|
+ }
|
|
|
+
|
|
|
+ //资金账单,下部列表
|
|
|
+ public function usermoney_lists(){
|
|
|
+ $keyword = input('keyword','');
|
|
|
+
|
|
|
+ $where = [
|
|
|
+ 'log.company_id' => $this->auth->company_id,
|
|
|
+ ];
|
|
|
+ if(!empty($keyword)){
|
|
|
+ $where['user.nickname|user.mobile'] = ['LIKE','%'.$keyword.'%'];
|
|
|
+ }
|
|
|
+ $lists = Db::name('user_money_log')->alias('log')
|
|
|
+ ->field('log.id,log.log_type,log.change_value,log.remain,log.remark,log.createtime,user.nickname,user.mobile')
|
|
|
+ ->join('user','log.user_id = user.id','LEFT')
|
|
|
+ ->where($where)->autopage()->select();
|
|
|
+
|
|
|
+ $this->success(1,$lists);
|
|
|
+ }
|
|
|
+
|
|
|
+ //数据中心
|
|
|
+ public function datacenter_one(){
|
|
|
+ $date = input('date',0);
|
|
|
+ $starttime = strtotime($date); //月初第一天
|
|
|
+ $endtime = strtotime("+1 month",$starttime) - 1; //月末最后一天
|
|
|
+
|
|
|
+ $ec_date = [];
|
|
|
+ $ec_ordernum = [];
|
|
|
+
|
|
|
+ $map = [
|
|
|
+ 'company_id' => $this->auth->company_id,
|
|
|
+ ];
|
|
|
+ if($this->auth->type == 2){
|
|
|
+ $map['staff_id'] = $this->auth->id;
|
|
|
+ }
|
|
|
+
|
|
|
+ for($i=$starttime;$i<$endtime;$i+=86400){
|
|
|
+ $starttime_i = $i;
|
|
|
+ $endtime_i = $i + 86399;
|
|
|
+ //日历
|
|
|
+ $ec_date[] = date('d',$starttime_i);
|
|
|
+ //下单人数
|
|
|
+ $map['finish_time'] = ['between',[$starttime_i,$endtime_i]];
|
|
|
+ $ec_ordernum[] = Db::name('order')->where($map)->count('id');
|
|
|
+ }
|
|
|
+
|
|
|
+ //饼图
|
|
|
+ $map['finish_time'] = ['between',[$starttime,$endtime]];
|
|
|
+ $servicetype = Db::name('servicetype')->field('id,title')->select();
|
|
|
+ foreach($servicetype as $key => &$val){
|
|
|
+ $map['servicetype_id'] = $val['id'];
|
|
|
+ $val['ordernum'] = Db::name('order')->where($map)->count('id');
|
|
|
+ }
|
|
|
+
|
|
|
+ $result = [
|
|
|
+ 'ec_data' => $ec_date,
|
|
|
+ 'ec_ordernum' => $ec_ordernum,
|
|
|
+ 'servicetype' => $servicetype,
|
|
|
+ ];
|
|
|
+ $this->success(1,$result);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function datacenter_two(){
|
|
|
+ $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');
|
|
|
+
|
|
|
+ $result = [
|
|
|
+ 'usernumber' => $usernumber,
|
|
|
+ 'summoney' => $summoney,
|
|
|
+ ];
|
|
|
+
|
|
|
+ $this->success(1,$result);
|
|
|
+ }
|
|
|
+ public function datacenter_three(){
|
|
|
+
|
|
|
+ }
|
|
|
+ public function datacenter_four(){
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|