add:商户合同发起签约
This commit is contained in:
parent
a15cd46512
commit
7c3143fbb9
@ -22,6 +22,7 @@ use app\common\model\contract\ShopContract;
|
|||||||
use app\common\model\contract\VehicleContract;
|
use app\common\model\contract\VehicleContract;
|
||||||
use app\common\model\ShopMerchant;
|
use app\common\model\ShopMerchant;
|
||||||
use app\common\model\vehicle\VehicleRent;
|
use app\common\model\vehicle\VehicleRent;
|
||||||
|
use Symfony\Component\HttpClient\HttpClient;
|
||||||
use think\cache\driver\Redis;
|
use think\cache\driver\Redis;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use think\facade\Log;
|
use think\facade\Log;
|
||||||
@ -129,7 +130,8 @@ class IndexController extends BaseApiController
|
|||||||
Log::info(['商户合同签约回调', $a]);
|
Log::info(['商户合同签约回调', $a]);
|
||||||
// 获取合同详情
|
// 获取合同详情
|
||||||
if ($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) {
|
||||||
// 合同一方已签约
|
// 合同一方已签约
|
||||||
if ($find['signing_timer'] == 0) {
|
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_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_a'])->update(['status' => 1, 'is_contract' => 1]);
|
||||||
Db::name('shop_merchant')->where('id', $find['party_b'])->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]
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user