80 lines
2.9 KiB
PHP
80 lines
2.9 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||
// +----------------------------------------------------------------------
|
||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||
// | 开源版本可自由商用,可去除界面版权logo
|
||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||
// | 访问官网:https://www.likeadmin.cn
|
||
// | likeadmin团队 版权所有 拥有最终解释权
|
||
// +----------------------------------------------------------------------
|
||
// | author: likeadminTeam
|
||
// +----------------------------------------------------------------------
|
||
|
||
namespace app\admin\logic;
|
||
|
||
|
||
use app\common\logic\BaseLogic;
|
||
use app\common\model\order\Cart;
|
||
use app\common\model\store_order\StoreOrder;
|
||
use app\common\model\store_visit\StoreVisit;
|
||
use app\common\service\ConfigService;
|
||
use app\common\service\FileService;
|
||
|
||
|
||
/**
|
||
* 工作台
|
||
* Class WorkbenchLogic
|
||
* @package app\admin\logic
|
||
*/
|
||
class WorkbenchLogic extends BaseLogic
|
||
{
|
||
/**
|
||
* @notes 工作套
|
||
* @param $adminInfo
|
||
* @return array
|
||
* @author 乔峰
|
||
* @date 2021/12/29 15:58
|
||
*/
|
||
public static function index()
|
||
{
|
||
return [
|
||
|
||
// 常用功能
|
||
|
||
];
|
||
}
|
||
|
||
//-------------------------------商品统计---------------------------------------//
|
||
|
||
/**
|
||
* 商品概况
|
||
*/
|
||
public static function get_basic($where)
|
||
{
|
||
$browse=StoreVisit::where($where)->count();
|
||
$user=0;
|
||
$cart=Cart::where($where)->where('is_fail',0)->sum('cart_num');
|
||
$order=StoreOrder::where($where)->count();
|
||
$pay=StoreOrder::where($where)->where('paid',1)->count();
|
||
$payPrice=StoreOrder::where($where)->where('paid',1)->count('pay_price');
|
||
$cost=StoreOrder::where($where)->where('paid',1)->sum('cost');
|
||
$refundPrice=StoreOrder::where($where)->where('status','in',[-1,-2])->sum('refund_price');
|
||
$refund=StoreOrder::where($where)->where('status','in',[-1,-2])->count();
|
||
$payPercent=0;
|
||
return [
|
||
'browse'=>['num'=>$browse,'title'=>'浏览量'],//浏览量
|
||
'user'=>['num'=>$user,'title'=>'访客数'],//访客数
|
||
'cart'=>['num'=>$cart,'title'=>'加购人数'],//加购人数
|
||
'order'=>['num'=>$order,'title'=>'订单量'],//订单量
|
||
'pay'=>['num'=>$pay,'title'=>'支付订单量'],//支付订单量
|
||
'payPrice'=>['num'=>$payPrice,'title'=>'支付金额'],//支付金额
|
||
'cost'=>['num'=>$cost,'title'=>'成本'],//成本
|
||
'refundPrice'=>['num'=>$refundPrice,'title'=>'退款金额'],//退款金额
|
||
'refund'=>['num'=>$refund,'title'=>'退款订单量'],//退款订单量
|
||
'payPercent'=>['num'=>$payPercent,'title'=>'支付转化率'],//支付转化率
|
||
];
|
||
}
|
||
}
|