check_status = 2; $approve->save(); } private static function refuse(Approve $approve, $params) { $approve->check_status = 3; $approve->remark = $params['remark']; $approve->save(); } private static function shopCallBack(Approve $approve, $shopMerchantInfo, $params, $userInfo) { $status = $params['check_status'] == 2? 1: 2; // 通过商户入驻审批, 记录商户入驻时间,镇农科公司市场部长任务会使用到 if ($status == 1 && $approve['type'] == 2) { $shopMerchantInfo = json_decode($approve['extend'], true); $data = [ 'town_company_id' => $userInfo['company_id'], 'mer_intention_id' => $shopMerchantInfo['mer_intention_id'], 'create_time' => time() ]; ShopMerchantSettleinLog::create($data); } // 通知商城审批状态 $requestResponse = HttpClient::create()->request('POST', env('url.shop_prefix') . '/api/merchant/syncStatus/'.$shopMerchantInfo['mer_intention_id'], [ 'body' => ['status' => $status, 'type' => $approve['type'] ==2 ? 1: 2, 'remark'=> $params['remark']??''] ]); Log::info(['通知商城审批状态-参数', ['status' => $status, 'type' => $approve['type']]]); Log::info(['通知商城审批状态-响应', [$requestResponse->getContent()]]); } public static function detail($id) { return Approve::where('id', $id)->withAttr('extend', function ($value, $data) { return json_decode($data['extend'], true); })->find(); } }