Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev

This commit is contained in:
From-wh 2023-03-23 14:03:00 +08:00
commit cc47a824b3
8 changed files with 29 additions and 4 deletions

View File

@ -458,7 +458,7 @@ class StoreOrder extends AuthController
*/
public function order_info($id)
{
if (!$id || !($orderInfo = $this->services->get($id))) {
if (!$id || !($orderInfo = $this->services->get($id, [], ['refund']))) {
return app('json')->fail(400118);
}
/** @var UserServices $services */
@ -497,6 +497,13 @@ class StoreOrder extends AuthController
} else
$orderInfo['_store_name'] = '';
$orderInfo['spread_name'] = $services->value(['uid' => $orderInfo['spread_uid']], 'nickname') ?? '无';
$orderInfo['_info'] = app()->make(StoreOrderCartInfoServices::class)->getOrderCartInfo((int)$orderInfo['id']);
$cart_num = 0;
$refund_num = array_sum(array_column($orderInfo['refund'], 'refund_num'));
foreach ($orderInfo['_info'] as $items) {
$cart_num += $items['cart_info']['cart_num'];
}
$orderInfo['is_all_refund'] = $refund_num == $cart_num;
$userInfo = $userInfo->toArray();
return app('json')->success(compact('orderInfo', 'userInfo'));
}

View File

@ -387,6 +387,9 @@ class User extends AuthController
if ($data['phone']) {
if (!preg_match("/^1[3456789]\d{9}$/", $data['phone'])) return app('json')->fail(400252);
}
if ($this->services->count(['phone' => $data['phone'], 'is_del' => 0])) {
return app('json')->fail(400314);
}
if ($data['card_id']) {
if (!check_card($data['card_id'])) return app('json')->fail(400315);
}

View File

@ -164,6 +164,7 @@ class UserDao extends BaseDao
->order('count desc')
->order('t0.uid desc')
->where('t1.spread_time', 'BETWEEN', $time)
->where('t0.is_del', 0)
->page($page, $limit)
->group('t0.uid')
->select()->toArray();

View File

@ -44,6 +44,7 @@ class WechatQrcodeRecordDao extends BaseDao
* @param $timeType
* @param $field
* @param $str
* @param string $orderStatus
* @return mixed
*/
public function getRecordTrend($qid, $time, $timeType, $field, $str, $orderStatus = '')

View File

@ -92,10 +92,13 @@ class LiveAnchorServices extends BaseServices
* @param int $id
* @param array $data
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function save(int $id, array $data)
{
$liveAnchor = $this->dao->get(['wechat' => $data['wechat']]);
$liveAnchor = $this->dao->get(['wechat' => $data['wechat'], 'is_del' => 0]);
if (!MiniProgramService::getRoleList(2, 0, 30, $data['wechat'])) {
throw new AdminException(400426);
}

View File

@ -32,6 +32,7 @@ class UserCancelServices extends BaseServices
/** @var WechatUserServices $wechatUserServices */
$wechatUserServices = app()->make(WechatUserServices::class);
$userServices->update($uid, ['is_del' => 1]);
$userServices->update(['spread_uid' => $uid], ['spread_uid' => 0, 'spread_time' => 0]);
$wechatUserServices->update(['uid' => $uid], ['is_del' => 1]);
}

View File

@ -219,7 +219,7 @@ class WechatQrcodeServices extends BaseServices
* @param int $isFollow
* @return mixed
*/
public function wechatQrcodeRecord($qrcodeInfo, $userInfo, $spreadInfo, $isFollow = 0)
public function wechatQrcodeRecord($qrcodeInfo, $userInfo, $spreadInfo, $isFollow = 1)
{
$response = $this->transaction(function () use ($qrcodeInfo, $userInfo, $spreadInfo, $isFollow) {

View File

@ -15,7 +15,16 @@
<div class="ivu-description-list-title">订单信息</div>
<Row class="mb10">
<Col span="12">订单ID:{{ orderDatalist.orderInfo.order_id }}</Col>
<Col span="12" class="fontColor1">订单状态:{{ orderDatalist.orderInfo._status._title }}</Col>
<Col span="12" class="fontColor1"
>订单状态:{{ orderDatalist.orderInfo._status._title }}
{{
orderDatalist.orderInfo.refund.length
? orderDatalist.orderInfo.is_all_refund
? '退款中'
: '部分退款中'
: ''
}}
</Col>
</Row>
<Row class="mb10">
<Col span="12">商品总数:{{ orderDatalist.orderInfo.total_num }}</Col>