Commit 214f92f6 by 杨树贤

添加账号判断接口

parent 5acc8b59
......@@ -94,4 +94,19 @@ class ExternalApiController extends Controller
(new MessageService())->sendMessage('supplier_apply_admin_notify', $data, 'vendor@ichunt.com', true);
$this->externalResponse(0, '申请供应商成功');
}
//判断是否有芯链账号
public function checkSupplierAccountExist(Request $request)
{
$supplierId = $request->get('supplier_id');
if (empty($supplierId)) {
$this->externalResponse(-1, '供应商ID不能为空');
}
$supplierAccount = SupplierAccountModel::where('supplier_id', $supplierId)->first();
if ($supplierAccount) {
$this->externalResponse(0, 'ok', '有芯链账号');
}
$this->externalResponse(-1, '没有找到芯链账号');
}
}
......@@ -78,6 +78,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Api'], function () {
Route::get('/api/external/searchSupplier', 'ExternalApiController@searchSupplier');
Route::match(['get', 'post'], '/api/external/checkSupplierApply', 'ExternalApiController@checkSupplierApply');
Route::match(['get', 'post'], '/api/external/applySupplier', 'ExternalApiController@applySupplier');
Route::match(['get', 'post'], '/api/external/checkSupplierAccountExist', 'ExternalApiController@checkSupplierAccountExist');
});
//同步相关的接口
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment