-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
747 changed files
with
5,717 additions
and
3,290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
crmeb/app/adminapi/controller/v1/setting/SystemAgreement.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace app\adminapi\controller\v1\setting; | ||
|
||
use app\adminapi\controller\AuthController; | ||
use app\services\other\AgreementServices; | ||
use think\facade\App; | ||
|
||
class SystemAgreement extends AuthController | ||
{ | ||
/** | ||
* 构造方法 | ||
* SystemCity constructor. | ||
* @param App $app | ||
* @param AgreementServices $services | ||
*/ | ||
public function __construct(App $app, AgreementServices $services) | ||
{ | ||
parent::__construct($app); | ||
$this->services = $services; | ||
} | ||
|
||
/** | ||
* 获取协议内容 | ||
* @param $type | ||
* @return mixed | ||
* @throws \think\db\exception\DataNotFoundException | ||
* @throws \think\db\exception\DbException | ||
* @throws \think\db\exception\ModelNotFoundException | ||
*/ | ||
public function getAgreement($type) | ||
{ | ||
if (!$type) return app('json')->fail('协议类型不存在'); | ||
$info = $this->services->getAgreementBytype($type); | ||
return app('json')->success($info); | ||
} | ||
|
||
/** | ||
* 保存协议内容 | ||
* @return mixed | ||
*/ | ||
public function saveAgreement() | ||
{ | ||
$data = $this->request->postMore([ | ||
['id', 0], | ||
['type', 0], | ||
['title', ''], | ||
['content', ''], | ||
]); | ||
$data['status'] = 1; | ||
$this->services->saveAgreement($data, $data['id']); | ||
return app('json')->success('保存成功'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.