mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-03 00:10:38 +00:00
Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev
This commit is contained in:
commit
2f1447b72b
@ -45,6 +45,8 @@ class StoreOrderInvoice extends AuthController
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['data', '', '', 'time'],
|
||||
['real_name', ''],
|
||||
['field_key', ''],
|
||||
[['type', 'd'], 0],
|
||||
]);
|
||||
$data = $this->services->chart($where);
|
||||
|
||||
@ -43,14 +43,13 @@ class MemberCardBatch extends AuthController
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['title', ''],
|
||||
// ['page', 1],
|
||||
// ['limit', 20],
|
||||
]);
|
||||
$data = $this->services->getList($where);
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
/** 保存卡片资源
|
||||
/**
|
||||
* 保存卡片资源
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
@ -15,6 +15,7 @@ use app\services\order\DeliveryServiceServices;
|
||||
use app\services\order\StoreOrderCartInfoServices;
|
||||
use app\services\order\StoreOrderCreateServices;
|
||||
use app\services\order\StoreOrderDeliveryServices;
|
||||
use app\services\order\StoreOrderEconomizeServices;
|
||||
use app\services\order\StoreOrderRefundServices;
|
||||
use app\services\order\StoreOrderServices;
|
||||
use app\services\order\StoreOrderWapServices;
|
||||
@ -105,17 +106,16 @@ class StoreOrderController
|
||||
* @param UserServices $userServices
|
||||
* @param $orderId
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function detail(Request $request, StoreOrderServices $services, UserServices $userServices, $orderId)
|
||||
{
|
||||
$order = $this->service->getOne(['order_id' => $orderId], '*', ['pink']);
|
||||
if (!$order) return app('json')->fail(410173);
|
||||
$order = $order->toArray();
|
||||
$nickname = $userServices->value(['uid' => $order['uid']], 'nickname');
|
||||
$orderInfo = $services->tidyOrder($order, true);
|
||||
unset($orderInfo['uid'], $orderInfo['seckill_id'], $orderInfo['pink_id'], $orderInfo['combination_id'], $orderInfo['bargain_id'], $orderInfo['status'], $orderInfo['total_postage']);
|
||||
$orderInfo['nickname'] = $nickname;
|
||||
return app('json')->success($orderInfo);
|
||||
$economizeServices = app()->make(StoreOrderEconomizeServices::class);
|
||||
$orderData = $services->getUserOrderByKey($economizeServices, $orderId, (int)$request->uid());
|
||||
$orderData['nickname'] = $userServices->value(['uid' => $orderData['uid']], 'nickname');
|
||||
return app('json')->success($orderData);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -32,11 +32,15 @@ class ArticleCategoryDao extends BaseDao
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章列表
|
||||
* 获取文章分类列表
|
||||
* @param array $where
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getList(array $where, int $page = 0, int $limit = 0)
|
||||
{
|
||||
|
||||
@ -495,7 +495,7 @@ class StoreOrderDao extends BaseDao
|
||||
*/
|
||||
public function chartTimePrice($start, $stop)
|
||||
{
|
||||
return $this->search(['is_del' => 0, 'paid' => 1, 'refund_status' => 0])
|
||||
return $this->search(['pid' => 0, 'is_del' => 0, 'paid' => 1, 'refund_status' => [0, 3]])
|
||||
->where('add_time', '>=', $start)
|
||||
->where('add_time', '<', $stop)
|
||||
->field('sum(pay_price) as num,FROM_UNIXTIME(add_time, \'%Y-%m-%d\') as time')
|
||||
@ -511,7 +511,7 @@ class StoreOrderDao extends BaseDao
|
||||
*/
|
||||
public function chartTimeNumber($start, $stop)
|
||||
{
|
||||
return $this->search(['is_del' => 0, 'paid' => 1, 'refund_status' => 0])
|
||||
return $this->search(['pid' => 0, 'is_del' => 0, 'paid' => 1, 'refund_status' => [0, 3]])
|
||||
->where('add_time', '>=', $start)
|
||||
->where('add_time', '<', $stop)
|
||||
->field('count(id) as num,FROM_UNIXTIME(add_time, \'%Y-%m-%d\') as time')
|
||||
|
||||
@ -45,7 +45,7 @@ class MemberCardBatch extends BaseModel
|
||||
public function searchTitleAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') {
|
||||
$query->where('title', $value);
|
||||
$query->where('title', 'like', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -39,23 +39,14 @@ class ArticleCategoryServices extends BaseServices
|
||||
* 获取文章分类列表
|
||||
* @param array $where
|
||||
* @return array
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getList(array $where)
|
||||
{
|
||||
[$page, $limit] = $this->getPageValue();
|
||||
$list = $this->dao->getList($where);
|
||||
if (!empty($list) && $where['title'] !== '') {
|
||||
$pids = Arr::getUniqueKey($list, 'pid');
|
||||
$parentList = $this->dao->getList(['id' => $pids]);
|
||||
$list = array_merge($list, $parentList);
|
||||
foreach ($list as $key => $item) {
|
||||
$arr = $item;
|
||||
unset($list[$key]);
|
||||
if (!in_array($arr, $list)) {
|
||||
$list[] = $arr;
|
||||
}
|
||||
}
|
||||
}
|
||||
$list = get_tree_children($list);
|
||||
$count = $this->dao->count($where);
|
||||
return compact('list', 'count');
|
||||
|
||||
@ -36,21 +36,28 @@ class StoreOrderInvoiceServices extends BaseServices
|
||||
|
||||
public function chart(array $where)
|
||||
{
|
||||
$where['is_pay'] = 1;
|
||||
//全部
|
||||
$data['all'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time']]);
|
||||
$data['all'] = (string)$this->dao->count($where);
|
||||
//待开
|
||||
$data['noOpened'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 1]);
|
||||
$where['type'] = 1;
|
||||
$data['noOpened'] = (string)$this->dao->count($where);
|
||||
//已开
|
||||
$data['opened'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 2]);
|
||||
$where['type'] = 2;
|
||||
$data['opened'] = (string)$this->dao->count($where);
|
||||
//退款
|
||||
$data['refund'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 3]);
|
||||
$where['type'] = 3;
|
||||
$data['refund'] = (string)$this->dao->count($where);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台获取开票列表
|
||||
* @param $where
|
||||
* @param array $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getList(array $where)
|
||||
{
|
||||
|
||||
@ -336,13 +336,19 @@ class ExportServices extends BaseServices
|
||||
$filename = $data['title'] . '批次列表_' . date('YmdHis', time());
|
||||
$export = $fileKey = [];
|
||||
if (!empty($data['data'])) {
|
||||
$userIds = array_column($data['data']->toArray(), 'use_uid');
|
||||
/** @var UserServices $userService */
|
||||
$userService = app()->make(UserServices::class);
|
||||
$userList = $userService->getColumn([['uid', 'in', $userIds]], 'nickname,phone,real_name', 'uid');
|
||||
|
||||
|
||||
$i = 0;
|
||||
foreach ($data['data'] as $item) {
|
||||
$one_data = [
|
||||
'card_number' => $item['card_number'],
|
||||
'card_password' => $item['card_password'],
|
||||
'user_name' => $item['user_name'],
|
||||
'user_phone' => $item['user_phone'],
|
||||
'user_name' => $userList[$item['use_uid']]['real_name'] ?: $userList[$item['use_uid']]['nickname'],
|
||||
'user_phone' => $userList[$item['use_uid']] ? $userList[$item['use_uid']]['phone'] : "",
|
||||
'use_time' => $item['use_time'],
|
||||
'use_uid' => $item['use_uid'] ? '已领取' : '未领取'
|
||||
];
|
||||
|
||||
@ -1259,7 +1259,7 @@ class StoreProductServices extends BaseServices
|
||||
$page = 1;
|
||||
$limit = $num;
|
||||
}
|
||||
$list = $this->dao->getSearchList($where, $page, $limit, ['id,store_name,cate_id,image,IFNULL(sales, 0) + IFNULL(ficti, 0) as sales,price,stock,activity,unit_name,presale']);
|
||||
$list = $this->dao->getSearchList($where, $page, $limit, ['id,store_name,cate_id,image,IFNULL(sales, 0) + IFNULL(ficti, 0) as sales,price,stock,activity,unit_name,presale,is_vip,vip_price']);
|
||||
$list = $this->getActivityList($list);
|
||||
return $list;
|
||||
}
|
||||
|
||||
@ -32,6 +32,10 @@ class MemberCardBatchServices extends BaseServices
|
||||
/**
|
||||
* 获取会员卡批次列表
|
||||
* @param array $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getList(array $where = [])
|
||||
{
|
||||
|
||||
@ -49,16 +49,15 @@ class MemberCardServices extends BaseServices
|
||||
}
|
||||
unset($where['is_use']);
|
||||
$list = $this->dao->getSearchList($where, $page, $limit);
|
||||
if ($list) {
|
||||
foreach ($list as $k => $v) {
|
||||
if ($v['use_uid']) {
|
||||
$user_info = $userService->getUserInfo($v['use_uid'], ['nickname', 'phone', 'real_name']);
|
||||
$list[$k]['username'] = $user_info['real_name'] ? $user_info['real_name'] : $user_info['nickname'];
|
||||
$list[$k]['phone'] = $user_info ? $user_info['phone'] : "";
|
||||
}
|
||||
$list[$k]['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
|
||||
$list[$k]['use_time'] = $v['use_time'] != 0 ? date('Y-m-d H:i:s', $v['use_time']) : "未使用";
|
||||
$userIds = array_column($list->toArray(), 'use_uid');
|
||||
$userList = $userService->getColumn([['uid', 'in', $userIds]], 'nickname,phone,real_name', 'uid');
|
||||
foreach ($list as $k => $v) {
|
||||
if ($v['use_uid']) {
|
||||
$list[$k]['username'] = $userList[$v['use_uid']]['real_name'] ?: $userList[$v['use_uid']]['nickname'];
|
||||
$list[$k]['phone'] = $userList[$v['use_uid']] ? $userList[$v['use_uid']]['phone'] : "";
|
||||
}
|
||||
$list[$k]['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
|
||||
$list[$k]['use_time'] = $v['use_time'] != 0 ? date('Y-m-d H:i:s', $v['use_time']) : "未使用";
|
||||
}
|
||||
$count = $this->dao->count($where);
|
||||
return compact('list', 'count');
|
||||
|
||||
@ -151,7 +151,7 @@
|
||||
<div class="list">
|
||||
<div class="title row">联系信息</div>
|
||||
<Row class="row">
|
||||
<Col span="12">真实姓名: {{ invoiceDetails.real_name }}</Col>
|
||||
<Col span="12">真实姓名: {{ invoiceDetails.name }}</Col>
|
||||
<Col span="12">联系电话: {{ invoiceDetails.user_phone }}</Col>
|
||||
</Row>
|
||||
<Row class="row">
|
||||
@ -178,7 +178,7 @@
|
||||
<div class="list">
|
||||
<div class="title row">联系信息</div>
|
||||
<Row class="row">
|
||||
<Col span="12">真实姓名: {{ invoiceDetails.real_name }}</Col>
|
||||
<Col span="12">真实姓名: {{ invoiceDetails.name }}</Col>
|
||||
<Col span="12">联系电话: {{ invoiceDetails.user_phone }}</Col>
|
||||
</Row>
|
||||
<Row class="row">
|
||||
@ -555,6 +555,7 @@ export default {
|
||||
this.timeVal = e;
|
||||
this.orderData.data = this.timeVal[0] ? this.timeVal.join('-') : '';
|
||||
this.getList();
|
||||
this.getTabs();
|
||||
},
|
||||
//订单状态搜索()
|
||||
selectChange() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user