chore: 添加静态资源文件和版本配置文件

添加大量图片、字体、音频等静态资源文件,包括用户界面图片、模板文件和安装界面素材
添加系统版本配置文件(.version)和常量定义文件(.constant)
更新供应商依赖文件,包括Symfony VarDumper组件和相关许可证文件
添加验证码配置文件(captcha.php)和.gitignore规则
This commit is contained in:
2026-03-06 20:14:23 +08:00
commit c9a98f342c
4485 changed files with 490986 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\controller\api\v1\work;
/**
* Class BaseWork
* @package app\controller\api\v1\work
*/
abstract class BaseWork
{
/**
* 客户userid
* @var string
*/
protected $userid;
/**
* 客户详细信息
* @var array
*/
protected $clientInfo;
/**
* @var \think\facade\Request|\think\Request
*/
protected $request;
/**
* BaseWorkController constructor.
*/
public function __construct()
{
$this->request = request();
$this->clientInfo = $this->request->clientInfo();
$this->userid = $this->request->userid();
}
/**
* @param $msg
* @param array $data
* @return mixed
*/
public function success($msg, array $data = [])
{
return app('json')->success($msg, $data);
}
/**
* @param string $msg
* @param array|null $data
* @return mixed
*/
public function fail($msg = 'fail', ?array $data = null)
{
return app('json')->fail($msg, $data);
}
}

View File

@@ -0,0 +1,39 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\controller\api\v1\work;
use app\services\work\WorkClientServices;
use think\annotation\Inject;
/**
* 客户
* Class SidebarController
* @package app\controller\api\v1\work
*/
class Client extends BaseWork
{
/**
* @var WorkClientServices
*/
#[Inject]
protected WorkClientServices $service;
/**
* @return mixed
*/
public function getClientInfo()
{
return $this->success($this->service->getClientInfo($this->userid, $this->clientInfo));
}
}

View File

@@ -0,0 +1,68 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\controller\api\v1\work;
use app\services\work\WorkGroupChatMemberServices;
use app\services\work\WorkGroupChatServices;
use crmeb\services\wechat\config\WorkConfig;
use think\annotation\Inject;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
/**
* 客户群
* Class GroupChatController
* @package app\controller\api\v1\work
*/
class GroupChat extends BaseWork
{
/**
* @var WorkGroupChatServices
*/
#[Inject]
protected WorkGroupChatServices $service;
/**
* @param WorkConfig $config
* @return mixed
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function getGroupInfo(WorkConfig $config)
{
$chatId = $this->request->param('chat_id');
if (!$chatId) {
return $this->fail('缺少参数');
}
$corpId = $config->corpId;
return $this->success($this->service->getGroupInfo($chatId, $corpId));
}
/**
* 获取群成员列表
* @param WorkGroupChatMemberServices $services
* @param $id
* @return mixed
*/
public function getChatMemberList(WorkGroupChatMemberServices $services, $id)
{
if (!$id) {
return $this->fail('缺少参数');
}
$name = $this->request->get('name', '');
return $this->success($services->getChatMemberList((int)$id, $name));
}
}

View File

@@ -0,0 +1,216 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\controller\api\v1\work;
use app\Request;
use app\services\activity\combination\StorePinkServices;
use app\services\activity\coupon\StoreCouponIssueServices;
use app\services\message\service\StoreServiceRecordServices;
use app\services\order\StoreOrderEconomizeServices;
use app\services\order\StoreOrderPromotionsServices;
use app\services\order\StoreOrderRefundServices;
use app\services\order\StoreOrderServices;
use app\services\order\StoreOrderStatusServices;
use app\services\store\SystemStoreServices;
use app\services\user\UserInvoiceServices;
use app\services\user\UserServices;
use think\annotation\Inject;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
/**
* 订单
* Class OrderController
* @package app\controller\api\v1\work
*/
class Order extends BaseWork
{
/**
* @var StoreOrderServices
*/
#[Inject]
protected StoreOrderServices $service;
/**
* 获取订单列表
* @param Request $request
* @param StoreServiceRecordServices $services
* @param StoreOrderRefundServices $storeOrderRefundServices
* @return mixed
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function getUserOrderList(Request $request, StoreServiceRecordServices $services, StoreOrderRefundServices $storeOrderRefundServices)
{
$where = $request->getMore([
['type', '', '', 'status'],
['search', '', '', 'real_name'],
]);
$uid = $this->clientInfo['uid'] ?? 0;
if (!$uid) {
return $this->success(['list' => [], 'count' => 0]);
}
$where['uid'] = $uid;
$where['is_del'] = 0;
$where['is_system_del'] = 0;
$where['refund_type'] = [0, 1, 3, 6];
if ($where['status'] == -1) {
$list = $storeOrderRefundServices->refundList(['uid' => $where['uid'], 'real_name' => $where['real_name'], 'refund_type' => [0, 1, 2, 4, 5]])['list'] ?? [];
} else {
$list = $this->service->getOrderApiList($where + ['pid' => 0], ['*'], ['pink', 'invoice']);
}
return $this->success($list);
}
/**
* 订单详情
* @param StoreOrderEconomizeServices $services
* @param StoreOrderPromotionsServices $storeOrderPromotiosServices
* @param $id 订单id
* @return mixed
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function orderInfo(StoreOrderEconomizeServices $services, StoreOrderPromotionsServices $storeOrderPromotiosServices, $id)
{
if (!$id || !($orderInfo = $this->service->get($id))) {
return $this->fail('订单不存在');
}
$order = $orderInfo->toArray();
$order['split'] = [];
//门店是否开启 || 门店自提是否开启
if (!sys_config('store_func_status', 1) || !sys_config('store_self_mention')) {
//关闭门店自提后 订单隐藏门店信息
$order['shipping_type'] = 1;
}
if ($order['verify_code']) {
$verify_code = $order['verify_code'];
$verify[] = substr($verify_code, 0, 4);
$verify[] = substr($verify_code, 4, 4);
$verify[] = substr($verify_code, 8);
$order['_verify_code'] = implode(' ', $verify);
}
//收银台订单 用户无信息 手机号
if ($order['shipping_type'] == 4 && $order['uid'] && !$order['real_name']) {
/** @var UserServices $userServices */
$userServices = app()->make(UserServices::class);
$userInfo = $userServices->getUserCacheInfo((int)$order['uid']);
$order['real_name'] = $userInfo['nickname'];
$order['user_phone'] = $userInfo['phone'];
}
$order['add_time_y'] = date('Y-m-d', $order['add_time']);
$order['add_time_h'] = date('H:i:s', $order['add_time']);
$order['system_store'] = false;
if (!$order['store_id'] && $order['shipping_type'] == 2) {
$order['store_id'] = $this->service->value(['pid' => $order['id']], 'store_id');
}
if ($order['store_id']) {
/** @var SystemStoreServices $storeServices */
$storeServices = app()->make(SystemStoreServices::class);
$order['system_store'] = $storeServices->getStoreDispose($order['store_id']);
}
$order['mapKey'] = sys_config('tengxun_map_key');
$order['yue_pay_status'] = (int)sys_config('balance_func_status') ? (int)1 : (int)2;//余额支付 1 开启 2 关闭
$order['pay_weixin_open'] = (int)sys_config('pay_weixin_open') ?? 0;//微信支付 1 开启 0 关闭
$order['ali_pay_status'] = (bool)sys_config('ali_pay_status');//支付包支付 1 开启 0 关闭
$orderData = $this->service->tidyOrder($order, true, true);
//核算优惠金额
$vipTruePrice = 0;
$refund_num = 0;
foreach ($orderData['cartInfo'] ?? [] as $key => &$cart) {
$vipTruePrice = bcadd((string)$vipTruePrice, (string)$cart['vip_sum_truePrice'], 2);
$refund_num = bcadd((string)$refund_num, (string)$cart['refund_num'], 0);
}
$orderData['vip_true_price'] = $vipTruePrice;
$orderData['total_price'] = floatval(bcsub((string)$orderData['total_price'], (string)$vipTruePrice, 2));
//优惠活动优惠详情
$orderData['promotions_detail'] = $storeOrderPromotiosServices->getOrderPromotionsDetail((int)$order['id']);
//同步查询订单商品为查询到 查询缓存信息
if (!$orderData['cartInfo']) {
$cartGroup = $this->service->getCacheOrderInfo((int)$order['uid'], $order['unique']);
$orderData['cartInfo'] = $cartGroup['cartInfo'] ?? [];
}
$economize = $services->get(['order_id' => $order['order_id']], ['postage_price', 'member_price']);
if ($economize) {
$orderData['postage_price'] = $economize['postage_price'];
$orderData['member_price'] = $economize['member_price'];
} else {
$orderData['postage_price'] = 0;
$orderData['member_price'] = 0;
}
$orderData['routine_contact_type'] = sys_config('routine_contact_type', 0);
/** @var UserInvoiceServices $userInvoice */
$userInvoice = app()->make(UserInvoiceServices::class);
$invoice_func = $userInvoice->invoiceFuncStatus();
$orderData['invoice_func'] = $invoice_func['invoice_func'];
$orderData['special_invoice'] = $invoice_func['special_invoice'];
$orderData['refund_cartInfo'] = [];
$orderData['refund_total_num'] = $orderData['total_num'];
$orderData['refund_pay_price'] = $orderData['pay_price'];
$orderData['is_apply_refund'] = !($refund_num >= $orderData['total_num']) && $this->service->isRefundAvailable((int)$order['id']);
$orderData['is_batch_refund'] = count($orderData['cartInfo']) > 1;
$orderData['pinkStatus'] = null;
if ($orderData['type'] == 3) {
/** @var StorePinkServices $pinkService */
$pinkService = app()->make(StorePinkServices::class);
$orderData['pinkStatus'] = $pinkService->value(['order_id' => $orderData['order_id']], 'status');
}
/** @var StoreOrderStatusServices $statusServices */
$statusServices = app()->make(StoreOrderStatusServices::class);
$log = $statusServices->getColumn(['oid' => $order['id']], 'change_time', 'change_type');
if (isset($log['delivery'])) {
$delivery = date('Y-m-d', $log['delivery']);
} elseif (isset($log['delivery_goods'])) {
$delivery = date('Y-m-d', $log['delivery_goods']);
} elseif (isset($log['delivery_fictitious'])) {
$delivery = date('Y-m-d', $log['delivery_fictitious']);
} else {
$delivery = '';
}
$orderData['order_log'] = [
'create' => isset($log['cache_key_create_order']) ? date('Y-m-d', $log['cache_key_create_order']) : '',
'pay' => isset($log['pay_success']) ? date('Y-m-d', $log['pay_success']) : '',
'delivery' => $delivery,
'take' => isset($log['take_delivery']) ? date('Y-m-d', $log['take_delivery']) : '',
'complete' => isset($log['check_order_over']) ? date('Y-m-d', $log['check_order_over']) : '',
];
if ($orderData['give_coupon']) {
$couponIds = is_string($orderData['give_coupon']) ? explode(',', $orderData['give_coupon']) : $orderData['give_coupon'];
/** @var StoreCouponIssueServices $couponIssueService */
$couponIssueService = app()->make(StoreCouponIssueServices::class);
$orderData['give_coupon'] = $couponIssueService->getColumn([['id', 'IN', $couponIds]], 'id,coupon_title');
}
$orderInfo = $orderData;
/** @var UserServices $services */
$userServices = app()->make(UserServices::class);
$userInfo = $userServices->get($orderInfo['uid']);
if (!$userInfo) {
return $this->fail('用户信息不存在');
}
$userInfo = $userInfo->hidden(['pwd', 'add_ip', 'last_ip', 'login_type']);
$userInfo['spread_name'] = '';
if ($userInfo['spread_uid']) {
$userInfo['spread_name'] = $userServices->value(['uid' => $userInfo['spread_uid']], 'nickname');
}
return $this->success(compact('orderInfo', 'userInfo'));
}
}

View File

@@ -0,0 +1,80 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\controller\api\v1\work;
use app\services\kefu\ProductServices;
use think\annotation\Inject;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
/**
* Class ProductController
* @package app\controller\api\v1\work
*/
class Product extends BaseWork
{
/**
* @var ProductServices
*/
#[Inject]
protected ProductServices $service;
/**
* 获取用户购买记录
* @param string $store_name
* @return mixed
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function getCartProductList(string $store_name = '')
{
$uid = $this->clientInfo['uid'] ?? 0;
if (!$uid) {
return $this->success([]);
}
return $this->success(get_thumb_water($this->service->getProductCartList((int)$uid, $store_name)));
}
/**
* 用户浏览记录
* @param string $store_name
* @return mixed
*/
public function getVisitProductList(string $store_name = '')
{
$uid = $this->clientInfo['uid'] ?? 0;
if (!$uid) {
return $this->success([]);
}
return $this->success(get_thumb_water($this->service->getVisitProductList((int)$uid, $store_name)));
}
/**
* 获取用户购买的热销商品
* @param string $store_name
* @return mixed
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function getProductHotSale(string $store_name = '')
{
$uid = $this->clientInfo['uid'] ?? 0;
if (!$uid) {
return $this->success([]);
}
return $this->success(get_thumb_water($this->service->getProductHotSale((int)$uid, $store_name)));
}
}

View File

@@ -0,0 +1,49 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\controller\api\v1\work;
use app\Request;
use crmeb\services\wechat\Work;
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
use think\Response;
/**
* 企业微信
* Class WorkController
* @package app\controller\api\v1\work
*/
class WorkController
{
/**
* 获取企业微信配置
* @param Request $request
* @return Response
*/
public function config(Request $request)
{
return response(['status' => 200, 'msg' => 'ok', 'data' => Work::getJsSDK($request->get('url', ''))], 200, [], 'json');
}
/**
* 获取应用配置
* @param Request $request
* @return Response
* @throws InvalidArgumentException
*/
public function agentConfig(Request $request)
{
return response(['status' => 200, 'msg' => 'ok', 'data' => Work::getAgentConfig($request->get('url', ''))], 200, [], 'json');
}
}