优化代码结构,修正语法错误,更新数据逻辑,添加订单记录。
This commit is contained in:
parent
28db13348b
commit
0d2318d86f
@ -29,7 +29,7 @@ class OpurchaseclassofferAllLists extends BaseAdminDataLists implements ListsSea
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['is_adopt', 'is_storage', 'is_retrieval'],
|
||||
'=' => ['is_adopt', 'is_storage', 'is_stream'],
|
||||
'between_time' => 'create_time'
|
||||
];
|
||||
}
|
||||
|
@ -255,14 +255,14 @@ class OpurchaseclassLogic extends BaseLogic
|
||||
$find->notes = $notes;
|
||||
$find->before_nums = $find->nums;
|
||||
$find->nums = $nums;
|
||||
$find->storage_admin_id=Request()->adminId;
|
||||
$price=0;
|
||||
$find->storage_admin_id = Request()->adminId;
|
||||
$price = 0;
|
||||
if ($nums != 0) {
|
||||
$price = bcmul($find['price'], $nums, 2);
|
||||
Supplier::where('id', $find['supplier_id'])->inc('mer_money', $price)->update();
|
||||
}
|
||||
$number=Opurchaseclass::where('id',$find['order_id'])->value('number');
|
||||
$time=time();
|
||||
$number = Opurchaseclass::where('id', $find['order_id'])->value('number');
|
||||
$time = time();
|
||||
//供应链获得流水
|
||||
$record = [
|
||||
'financial_record_sn' => $time,
|
||||
@ -279,14 +279,13 @@ class OpurchaseclassLogic extends BaseLogic
|
||||
FinancialRecord::create($record);
|
||||
}
|
||||
$res = $find->save();
|
||||
$jg_register_id = Db::name('user_auth_shop')->where('pid', $find['supplier_id'])->where('type',2)->value('jg_register_id');
|
||||
if($jg_register_id){
|
||||
$jg=(new JgPushService())->sendMsg($jg_register_id, '平台提醒:您的商品已被采纳,请尽快发货' , '/pages/quote/list');
|
||||
if($jg!==true){
|
||||
$jg_register_id = Db::name('user_auth_shop')->where('pid', $find['supplier_id'])->where('type', 2)->value('jg_register_id');
|
||||
if ($jg_register_id) {
|
||||
$jg = (new JgPushService())->sendMsg($jg_register_id, '平台提醒:您的商品已被采纳,请尽快发货', '/pages/quote/list');
|
||||
if ($jg !== true) {
|
||||
Db::rollback();
|
||||
self::setError('设置成功。但极光推送失败:'.$jg);
|
||||
self::setError('设置成功。但极光推送失败:' . $jg);
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
if ($res) {
|
||||
|
@ -92,7 +92,11 @@ class SupplierLogic extends BaseLogic
|
||||
*/
|
||||
public static function status(array $params): bool
|
||||
{
|
||||
$apply_info = Db::name('user_auth_shop')->where('id', $params['apply_id'])->findOrEmpty();
|
||||
$apply_info = Db::name('user_auth_shop')->where('id', $params['apply_id'])->find();
|
||||
if(!$apply_info){
|
||||
self::setError('商户中间数据不存在');
|
||||
return false;
|
||||
}
|
||||
Db::startTrans();
|
||||
try {
|
||||
if ($params['status'] == 1) {
|
||||
@ -150,7 +154,7 @@ class SupplierLogic extends BaseLogic
|
||||
Supplier::where('id', $params['id'])->update([
|
||||
'status' => 0,
|
||||
]);
|
||||
Db::name('user_auth_shop')->where('id', $params['apply_id'])->update($data);
|
||||
Db::name('user_auth_shop')->where('id', $apply_info['id'])->update($data);
|
||||
}
|
||||
|
||||
if (!empty($apply_info['jg_register_id'])) {
|
||||
|
@ -121,6 +121,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
} else {
|
||||
PushService::push('store_merchant_' . $order['merchant'], $order['merchant'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
||||
Redis::send('push-platform-print', ['order_id' => $order['id']], 60);
|
||||
Db::name('order_middle')->insert(['c_order_id' =>$order['id']]);
|
||||
}
|
||||
if (!empty($extra['payer']['openid']) && $order->pay_type != 9) {
|
||||
Redis::send('push-delivery', ['order_id' => $orderSn, 'openid' => $extra['payer']['openid']], 5);
|
||||
@ -135,6 +136,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
$order = Opurchaseclass::where('number', $orderSn)->findOrEmpty();
|
||||
$order_arr = explode(',', $order['order_arr']);
|
||||
(new FinancialRecord())->where('order_id', 'in', $order_arr)->update(['status' => 1]);
|
||||
Db::name('order_middle')->where('c_order_id', 'in', $order_arr)->update(['b_order_id' => $order['id']]);
|
||||
$time = time();
|
||||
//商户支出流水
|
||||
$record[] = [
|
||||
@ -173,6 +175,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
$order = Opurchaseclass::where('number', $orderSn)->findOrEmpty();
|
||||
$order_arr = explode(',', $order['order_arr']);
|
||||
(new FinancialRecord())->where('order_id', 'in', $order_arr)->update(['status' => 1]);
|
||||
Db::name('order_middle')->where('b_order_id', 'in', $order_arr)->update(['p_order_id' => $order['id']]);
|
||||
$time = time();
|
||||
//平台支出流水
|
||||
$record[] = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user