Merge branch 'zhangwei' into yaooo

This commit is contained in:
yaooo 2023-11-14 16:39:03 +08:00
commit 537d679f9c
8 changed files with 110 additions and 66 deletions

View File

@ -28,6 +28,7 @@ class BaseAdminController extends BaseLikeAdminController
{ {
protected int $adminId = 0; protected int $adminId = 0;
protected array $adminInfo = []; protected array $adminInfo = [];
protected array $reqHeader = [];
public function initialize() public function initialize()
{ {
@ -35,6 +36,11 @@ class BaseAdminController extends BaseLikeAdminController
$this->adminInfo = $this->request->adminInfo; $this->adminInfo = $this->request->adminInfo;
$this->adminId = $this->request->adminInfo['admin_id']; $this->adminId = $this->request->adminInfo['admin_id'];
} }
$this->reqHeader = [
"appid:".env('app.app_id'),
"timestamp:".time(),
"sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret'))
];
} }
} }

View File

@ -7,17 +7,6 @@
class ArchivesController extends BaseAdminController class ArchivesController extends BaseAdminController
{ {
protected array $reqHeader = [];
public function initialize()
{
parent::initialize();
$this->reqHeader = [
"appid:".env('app.app_id'),
"timestamp:".time(),
"sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret'))
];
}
//档案列表 //档案列表
public function lists(): Json public function lists(): Json
{ {

View File

@ -7,17 +7,6 @@
class BusinessController extends BaseAdminController class BusinessController extends BaseAdminController
{ {
protected array $reqHeader = [];
public function initialize()
{
parent::initialize();
$this->reqHeader = [
"appid:".env('app.app_id'),
"timestamp:".time(),
"sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret'))
];
}
//商机分类列表 //商机分类列表
public function lists(): Json public function lists(): Json
{ {

View File

@ -7,17 +7,6 @@
class CompanyController extends BaseAdminController class CompanyController extends BaseAdminController
{ {
protected array $reqHeader = [];
public function initialize()
{
parent::initialize();
$this->reqHeader = [
"appid:".env('app.app_id'),
"timestamp:".time(),
"sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret'))
];
}
//公司列表 //公司列表
public function lists(): Json public function lists(): Json
{ {

View File

@ -7,17 +7,6 @@
class MerchantController extends BaseAdminController class MerchantController extends BaseAdminController
{ {
protected array $reqHeader = [];
public function initialize()
{
parent::initialize();
$this->reqHeader = [
"appid:".env('app.app_id'),
"timestamp:".time(),
"sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret'))
];
}
//商户档案列表 //商户档案列表
public function merchantRecordLists(): Json public function merchantRecordLists(): Json
{ {

View File

@ -7,17 +7,6 @@
class CompanyContractController extends BaseAdminController class CompanyContractController extends BaseAdminController
{ {
protected array $reqHeader = [];
public function initialize()
{
parent::initialize();
$this->reqHeader = [
"appid:".env('app.app_id'),
"timestamp:".time(),
"sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret'))
];
}
//合同列表 //合同列表
public function lists(): Json public function lists(): Json
{ {

View File

@ -0,0 +1,104 @@
<?php
namespace app\adminapi\controller\contract;
use app\adminapi\controller\BaseAdminController;
use think\response\Json;
class ShopContractController extends BaseAdminController
{
//商户合同列表
public function lists(): Json
{
$params = $this->request->get(['page_no','page_size','contract_no','party_a','party_b','status']);
$result = curl_post(env('project.worker_domain').'/middleapi/ShopContract/lists',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
//商户合同详情
public function detail(): Json
{
$params = $this->request->get(['id']);
if(empty($params['id'])){
return $this->fail('缺少必要参数');
}
$result = curl_post(env('project.worker_domain').'/middleapi/ShopContract/detail',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
//商户合同审核
public function check(): Json
{
$params = $this->request->post(['id','file']);
if(empty($params['id']) || empty($params['file'])){
return $this->fail('缺少必要参数');
}
$result = curl_post(env('project.worker_domain').'/middleapi/ShopContract/check',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
//商户合同备注
public function note(): Json
{
$params = $this->request->post(['id','notes']);
if(empty($params['id']) || empty($params['notes'])){
return $this->fail('缺少必要参数');
}
$result = curl_post(env('project.worker_domain').'/middleapi/ShopContract/note',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
//发送商户合同
public function draftContract(): Json
{
$params = $this->request->post(['id']);
if(empty($params['id'])){
return $this->fail('缺少必要参数');
}
$result = curl_post(env('project.worker_domain').'/middleapi/ShopContract/draftContract',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
//发送短信
public function sendSms(): Json
{
$params = $this->request->post(['id']);
if(empty($params['id'])){
return $this->fail('缺少必要参数');
}
$result = curl_post(env('project.worker_domain').'/middleapi/ShopContract/sendSms',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
//下载证据包
public function evidence(): Json
{
$params = $this->request->get(['id']);
if(empty($params['id'])){
return $this->fail('缺少必要参数');
}
$result = curl_post(env('project.worker_domain').'/middleapi/ShopContract/evidence',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
}

View File

@ -7,17 +7,6 @@
class VehicleContractController extends BaseAdminController class VehicleContractController extends BaseAdminController
{ {
protected array $reqHeader = [];
public function initialize()
{
parent::initialize();
$this->reqHeader = [
"appid:".env('app.app_id'),
"timestamp:".time(),
"sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret'))
];
}
//三轮车合同列表 //三轮车合同列表
public function lists(): Json public function lists(): Json
{ {