2024-05-30 21:37:55 +08:00
|
|
|
|
<?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;
|
2024-06-12 15:05:44 +08:00
|
|
|
|
use app\common\model\store_order\StoreOrder;
|
|
|
|
|
use app\common\model\store_visit\StoreVisit;
|
2024-05-30 21:37:55 +08:00
|
|
|
|
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 [
|
|
|
|
|
|
2024-06-12 15:05:44 +08:00
|
|
|
|
// 常用功能
|
2024-05-30 21:37:55 +08:00
|
|
|
|
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-12 15:05:44 +08:00
|
|
|
|
//-------------------------------商品统计---------------------------------------//
|
2024-05-30 21:37:55 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2024-06-12 15:05:44 +08:00
|
|
|
|
* 商品概况
|
2024-05-30 21:37:55 +08:00
|
|
|
|
*/
|
2024-06-12 15:05:44 +08:00
|
|
|
|
public static function get_basic($where)
|
2024-05-30 21:37:55 +08:00
|
|
|
|
{
|
2024-06-12 15:05:44 +08:00
|
|
|
|
$browse=StoreVisit::where($where)->count();
|
|
|
|
|
$user=0;
|
|
|
|
|
$cart=0;
|
|
|
|
|
$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;
|
2024-05-30 21:37:55 +08:00
|
|
|
|
return [
|
2024-06-12 15:05:44 +08:00
|
|
|
|
'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'=>'支付转化率'],//支付转化率
|
2024-05-30 21:37:55 +08:00
|
|
|
|
];
|
|
|
|
|
}
|
2024-06-12 15:05:44 +08:00
|
|
|
|
}
|