feat: 增加用户积分查询和门店信息查询功能
This commit is contained in:
parent
6aa8964f55
commit
a82e96e259
@ -147,7 +147,7 @@ class UserLogic extends BaseLogic
|
|||||||
public static function detail(int $userId): array
|
public static function detail(int $userId): array
|
||||||
{
|
{
|
||||||
$field = [
|
$field = [
|
||||||
'id', 'account', 'nickname', 'avatar', 'real_name',
|
'id', 'account', 'nickname', 'avatar', 'real_name','integral',
|
||||||
'sex', 'mobile', 'create_time', 'login_time', 'channel','now_money','purchase_funds'
|
'sex', 'mobile', 'create_time', 'login_time', 'channel','now_money','purchase_funds'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -24,15 +24,24 @@ class StoreController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店信息
|
||||||
|
*/
|
||||||
public function detail()
|
public function detail()
|
||||||
{
|
{
|
||||||
$store_id = (int)$this->request->get('store_id');
|
$store_id = (int)$this->request->get('store_id');
|
||||||
$where = [
|
$phone = (int)$this->request->get('phone');
|
||||||
'id' => $store_id
|
$where = [];
|
||||||
];
|
if($phone){
|
||||||
|
$where['phone'] = $phone;
|
||||||
|
}
|
||||||
|
if($store_id){
|
||||||
|
$where['id'] = $store_id;
|
||||||
|
}
|
||||||
|
|
||||||
$info = StoreLogic::search($where);
|
$info = StoreLogic::search($where);
|
||||||
if ($info) {
|
if ($info) {
|
||||||
return $this->data($info);
|
return $this->data($info?->toArray());
|
||||||
} else {
|
} else {
|
||||||
return $this->fail('店铺不存在');
|
return $this->fail('店铺不存在');
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ class UserLogic extends BaseLogic
|
|||||||
{
|
{
|
||||||
$data = User::with(['userShip'])->where('id',$uid)
|
$data = User::with(['userShip'])->where('id',$uid)
|
||||||
->field('id,avatar,real_name,nickname,account,mobile,sex,login_ip,now_money,total_recharge_amount,user_ship
|
->field('id,avatar,real_name,nickname,account,mobile,sex,login_ip,now_money,total_recharge_amount,user_ship
|
||||||
,purchase_funds')
|
,purchase_funds,integral')
|
||||||
->find();
|
->find();
|
||||||
//判断是不是员工
|
//判断是不是员工
|
||||||
if($data){
|
if($data){
|
||||||
|
@ -81,7 +81,7 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
$capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order['pay_price']);
|
$capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order['pay_price']);
|
||||||
// self::afterPay($order);
|
// self::afterPay($order);
|
||||||
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
||||||
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
$capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $order['id'], $order['pay_price']);
|
$capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $order['id'], $order['pay_price']);
|
||||||
// self::afterPay($order);
|
// self::afterPay($order);
|
||||||
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
||||||
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -153,12 +153,13 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
|
|
||||||
if ($order->pay_type == 9) {
|
if ($order->pay_type == 9) {
|
||||||
$extra['create_time'] = $order['create_time'];
|
$extra['create_time'] = $order['create_time'];
|
||||||
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'cash_register', 'msg' => '您有一笔订单已支付', 'data' => $extra]);
|
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'cash_register', 'msg' => '您有一笔订单已支付', 'data' => $extra]);
|
||||||
Redis::send('push-platform-print', ['id' => $order['id']]);
|
Redis::send('push-platform-print', ['id' => $order['id']]);
|
||||||
} else {
|
|
||||||
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
|
||||||
// Db::name('order_middle')->insert(['c_order_id' => $order['id']]);
|
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
||||||
|
// Db::name('order_middle')->insert(['c_order_id' => $order['id']]);
|
||||||
|
// }
|
||||||
if (!empty($extra['payer']['openid']) && $order->pay_type == 7) {
|
if (!empty($extra['payer']['openid']) && $order->pay_type == 7) {
|
||||||
Redis::send('push-delivery', ['order_id' => $order['order_id'], 'openid' => $extra['payer']['openid']], 5);
|
Redis::send('push-delivery', ['order_id' => $order['order_id'], 'openid' => $extra['payer']['openid']], 5);
|
||||||
}
|
}
|
||||||
@ -280,12 +281,12 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
|
|
||||||
if ($order->pay_type == 9) {
|
if ($order->pay_type == 9) {
|
||||||
$extra['create_time'] = $order['create_time'];
|
$extra['create_time'] = $order['create_time'];
|
||||||
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'cash_register', 'msg' => '您有一笔订单已支付', 'data' => $extra]);
|
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'cash_register', 'msg' => '您有一笔订单已支付', 'data' => $extra]);
|
||||||
Redis::send('push-platform-print', ['id' => $order['id']]);
|
Redis::send('push-platform-print', ['id' => $order['id']]);
|
||||||
|
|
||||||
} else {
|
|
||||||
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
||||||
|
// }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,12 +183,12 @@ class StoreOrderController extends BaseAdminController
|
|||||||
case PayEnum::PURCHASE_FUNDS:
|
case PayEnum::PURCHASE_FUNDS:
|
||||||
//采购款支付
|
//采购款支付
|
||||||
PayNotifyLogic::handle('purchase_funds', $order['order_id'],['uid'=>$this->request->post('uid')]);
|
PayNotifyLogic::handle('purchase_funds', $order['order_id'],['uid'=>$this->request->post('uid')]);
|
||||||
return $this->success('采购款支付成功',[],1,0);
|
return $this->success('采购款支付成功',['id'=>$order['id']]);
|
||||||
|
|
||||||
case PayEnum::CASH_PAY:
|
case PayEnum::CASH_PAY:
|
||||||
//现金支付
|
//现金支付
|
||||||
PayNotifyLogic::handle('cash_pay', $order['order_id']);
|
PayNotifyLogic::handle('cash_pay', $order['order_id']);
|
||||||
return $this->success('现金支付成功');
|
return $this->success('现金支付成功',['id'=>$order['id']]);
|
||||||
|
|
||||||
case PayEnum::WECHAT_PAY_BARCODE:
|
case PayEnum::WECHAT_PAY_BARCODE:
|
||||||
//微信条码支付
|
//微信条码支付
|
||||||
@ -250,7 +250,7 @@ class StoreOrderController extends BaseAdminController
|
|||||||
case PayEnum::CASH_PAY:
|
case PayEnum::CASH_PAY:
|
||||||
//现金支付
|
//现金支付
|
||||||
PayNotifyLogic::handle('cash_pay', $order['order_id']);
|
PayNotifyLogic::handle('cash_pay', $order['order_id']);
|
||||||
return $this->success('现金支付成功');
|
return $this->success('现金支付成功',['id'=>$order['id']]);
|
||||||
break;
|
break;
|
||||||
case PayEnum::WECHAT_PAY_BARCODE:
|
case PayEnum::WECHAT_PAY_BARCODE:
|
||||||
//微信条码支付
|
//微信条码支付
|
||||||
|
@ -38,7 +38,7 @@ class UserLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
|
|
||||||
$field = "id,nickname,real_name,sex,avatar,account,mobile,now_money,user_ship,create_time,purchase_funds";
|
$field = "id,nickname,real_name,sex,avatar,account,mobile,now_money,user_ship,create_time,purchase_funds,integral";
|
||||||
$lists = User::where($this->searchWhere)
|
$lists = User::where($this->searchWhere)
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->field($field)
|
->field($field)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user