更新文件
This commit is contained in:
parent
96d20241b7
commit
4cf5366fdc
@ -13,9 +13,12 @@
|
||||
|
||||
use app\common\repositories\system\config\ConfigValueRepository;
|
||||
use app\common\repositories\system\groupData\GroupDataRepository;
|
||||
use crmeb\jobs\SendSmsJob;
|
||||
use crmeb\services\UploadService;
|
||||
use Swoole\Lock;
|
||||
use think\db\BaseQuery;
|
||||
use think\facade\Db;
|
||||
use think\facade\Queue;
|
||||
|
||||
if (!function_exists('go')) {
|
||||
function go(): bool
|
||||
@ -1152,5 +1155,28 @@ if (!function_exists('checkSuffix')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('Financial_Operations')) {
|
||||
|
||||
function Financial_Operations($activity_type,$order_id,$tempId='ORDER_CREATE',$id=0){
|
||||
//发送运营财务短信
|
||||
$group_id=0;
|
||||
if($activity_type==98){
|
||||
$group_id=Db::name('system_group')->where('group_key','city_operations')->value('group_id');
|
||||
}else{
|
||||
$group_id=Db::name('system_group')->where('group_key','town_operation')->value('group_id');
|
||||
}
|
||||
if($group_id){
|
||||
$group_value=Db::name('system_group_data')->where('group_id',$group_id)->column('value');
|
||||
if($group_value){
|
||||
foreach($group_value as $k=>$v){
|
||||
$phone=json_decode($v,true);
|
||||
Queue::push(SendSmsJob::class, ['tempId' => $tempId, 'phone' => $phone['phone'],'orderId'=>$order_id,'id'=>$id]);//短信通知
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -722,6 +722,9 @@ class StoreOtherOrderCreateRepository extends StoreOtherOrderRepository
|
||||
Db::name('store_order_product_other')->insertAll($orderProduct);
|
||||
return $groupOrder;
|
||||
});
|
||||
|
||||
//下单发送运营财务短信
|
||||
Financial_Operations(98,$groupOrder['group_order_sn'],'ORDER_CREATE');
|
||||
return $group;
|
||||
}
|
||||
}
|
||||
|
@ -298,6 +298,12 @@ class StoreOtherOrderRepository extends BaseRepository
|
||||
// if (!$is_combine) {
|
||||
// app()->make(MerchantRepository::class)->addLockMoney($order->mer_id, 'order', $order->order_id, $_payPrice);
|
||||
// }
|
||||
//短信 订单通知商户
|
||||
$mer_phone=Db::name('merchant')->where('mer_id',$order->mer_id)->value('mer_phone');
|
||||
if($mer_phone){
|
||||
Queue::push(SendSmsJob::class, ['tempId' => 'ORDER_CREATE', 'phone' => $mer_phone,'orderId'=>$order->order_id,'id'=>0]);//短信通知
|
||||
}
|
||||
|
||||
}
|
||||
$userMerchantRepository->updatePayTime($uid, $order->mer_id, $order->pay_price);
|
||||
SwooleTaskService::merchant('notice', [
|
||||
@ -309,22 +315,6 @@ class StoreOtherOrderRepository extends BaseRepository
|
||||
]
|
||||
], $order->mer_id);
|
||||
|
||||
$group_id=0;
|
||||
if($order->activity_type==98){
|
||||
$group_id=Db::name('system_group')->where('group_key','city_operations')->value('group_id');
|
||||
}else{
|
||||
$group_id=Db::name('system_group')->where('group_key','town_operation')->value('group_id');
|
||||
}
|
||||
if($group_id){
|
||||
$group_value=Db::name('system_group_data')->where('group_id',$group_id)->column('value');
|
||||
if($group_value){
|
||||
foreach($group_value as $k=>$v){
|
||||
$phone=json_decode($v,true);
|
||||
Queue::push(SendSmsJob::class, ['tempId' => 'ORDER_CREATE', 'phone' => $phone['phone'],'orderId'=>$order->order_id,'id'=>0]);//短信通知
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$this->giveIntegral($groupOrder);
|
||||
@ -332,6 +322,7 @@ class StoreOtherOrderRepository extends BaseRepository
|
||||
$storeOrderStatusRepository->batchCreateLog($orderStatus);
|
||||
$groupOrder->save();
|
||||
Db::commit();
|
||||
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Log::error('财务点击支付失败'.$e->getMessage());
|
||||
@ -615,6 +606,8 @@ class StoreOtherOrderRepository extends BaseRepository
|
||||
$this->takeAfter($order, $user);
|
||||
$order->save();
|
||||
$storeOrderStatusRepository->{$func}($orderStatus);
|
||||
Financial_Operations(98,$order->order_id,'OTHER_ADMIN_TAKE_DELIVERY_CODE',$order->order_id);
|
||||
|
||||
});
|
||||
// event('order.take', compact('order'));
|
||||
}
|
||||
@ -1256,9 +1249,6 @@ class StoreOtherOrderRepository extends BaseRepository
|
||||
$query = $this->dao->search($where, null)->where($this->getOrderType($status))
|
||||
->with([
|
||||
'orderProduct',
|
||||
'merchant' => function ($query) {
|
||||
return $query->field('mer_id,mer_name,is_trader,financial_bank,auto_margin_rate,commission_rate');
|
||||
},
|
||||
'verifyService' => function ($query) {
|
||||
return $query->field('service_id,nickname');
|
||||
},
|
||||
@ -1278,7 +1268,7 @@ class StoreOtherOrderRepository extends BaseRepository
|
||||
},
|
||||
]);
|
||||
$count = $query->count();
|
||||
$list = $query->page($page, $limit)->select()->each(function ($item) {
|
||||
$list = $query->page($page, $limit)->select()->each(function ($item) use($status){
|
||||
$auto_margin= Db::name('financial_record_transfer')
|
||||
->where('order_id',$item['order_id'])->where('financial_type','auto_margin')->where('financial_pm',0)->value('number');
|
||||
$order_charge= Db::name('financial_record_transfer')
|
||||
@ -1289,6 +1279,11 @@ class StoreOtherOrderRepository extends BaseRepository
|
||||
'order_charge'=>$order_charge,
|
||||
'order_charge_lv'=>$item->merchant->commission_rate?round($item->merchant->commission_rate,2):0,
|
||||
];
|
||||
if(in_array($status,[4,5])){
|
||||
$item['merchant']= Db::name('merchant')->where('mer_id',$item['mer_id'])->field('mer_id,mer_name,is_trader,financial_bank,auto_margin_rate,commission_rate')->find();
|
||||
}else{
|
||||
$item['merchant']= Db::name('merchant')->where('uid',$item['uid'])->where('status',1)->field('mer_id,mer_name,is_trader,financial_bank,auto_margin_rate,commission_rate')->find();
|
||||
}
|
||||
});
|
||||
return compact('count', 'list');
|
||||
}
|
||||
|
@ -288,4 +288,17 @@ class StoreOrderOther extends BaseController
|
||||
$res = $orderRepository->show($id, $this->request->uid());
|
||||
return app('json')->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传凭证
|
||||
*/
|
||||
public function upload_voucher($order_id){
|
||||
$find=Db::name('store_order_other')->where('order_id',$order_id)->where('uid', $this->request->uid())->find();
|
||||
if($find){
|
||||
Financial_Operations(98,$order_id,'ADMIN_PAY_SUCCESS_CODE');
|
||||
return app('json')->success('操作成功');
|
||||
}
|
||||
return app('json')->fail('操作失败');
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,8 +12,10 @@
|
||||
namespace crmeb\services;
|
||||
|
||||
use app\common\repositories\store\broadcast\BroadcastRoomRepository;
|
||||
use app\common\repositories\store\order\StoreGroupOrderOtherRepository;
|
||||
use app\common\repositories\store\order\StoreGroupOrderRepository;
|
||||
use app\common\repositories\store\order\StoreOrderRepository;
|
||||
use app\common\repositories\store\order\StoreOtherOrderRepository;
|
||||
use app\common\repositories\store\order\StoreRefundOrderRepository;
|
||||
use app\common\repositories\store\product\ProductRepository;
|
||||
use app\common\repositories\store\product\ProductTakeRepository;
|
||||
@ -285,9 +287,20 @@ class SmsService
|
||||
case 'MERCHANT_CREDIT_BUY_NOTICE':
|
||||
self::sendMerMessage($id, $tempId, ['order_id' => $data['orderId']]);
|
||||
break;
|
||||
//下单通知
|
||||
case 'ORDER_CREATE':
|
||||
self::create()->send($data['phone'], $tempId, ['name' => $data['orderId']]);
|
||||
break;
|
||||
//管理员确认收货提醒
|
||||
case 'OTHER_ADMIN_TAKE_DELIVERY_CODE':
|
||||
$order = app()->make(StoreOtherOrderRepository::class)->get($id);
|
||||
if (!$order) return;
|
||||
self::sendMerMessage($order->mer_id, 'ADMIN_TAKE_DELIVERY_CODE', ['order_id' => $order->order_sn]);
|
||||
break;
|
||||
//管理员 支付成功提醒
|
||||
case 'OTHER_ADMIN_PAY_SUCCESS_CODE':
|
||||
self::create()->send($data['phone'], 'ADMIN_PAY_SUCCESS_CODE', ['order_id' => $data['orderId']]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user