diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index 494e965c9..a548444cd 100755 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -22,6 +22,7 @@ use app\common\model\contract\ShopContract; use app\common\model\contract\VehicleContract; use app\common\model\ShopMerchant; use app\common\model\vehicle\VehicleRent; +use Symfony\Component\HttpClient\HttpClient; use think\cache\driver\Redis; use think\facade\Db; use think\facade\Log; @@ -129,7 +130,8 @@ class IndexController extends BaseApiController Log::info(['商户合同签约回调', $a]); // 获取合同详情 if ($a) { - $find = Db::name('contract')->where('id', $a['id'])->find(); + $find = Db::name('shop_contract')->where('id', $a['id'])->find(); + if ($find) { // 合同一方已签约 if ($find['signing_timer'] == 0) { @@ -140,7 +142,11 @@ class IndexController extends BaseApiController Db::name('shop_contract')->where('id', $a['id'])->update(['status' => 1, 'signing_timer' => 2]); Db::name('shop_merchant')->where('id', $find['party_a'])->update(['status' => 1, 'is_contract' => 1]); Db::name('shop_merchant')->where('id', $find['party_b'])->update(['status' => 1, 'is_contract' => 1]); - // todo 通知商城,商户签约完成 + // 通知商城,商户签约完成 + $shopMerchant = ShopMerchant::find(['id' => $find['party_b']]); + $requestUtil = HttpClient::create()->request('POST', env('url.shop_prefix') . '/api/merchant/syncStatus?mer_intention_id='.$shopMerchant['mer_intention_id'], [ + 'body' => ['status' =>2] + ]); } } }