AgreementController.php 489 B

12345678910111213141516171819202122
  1. <?php
  2. namespace app\index\controller;
  3. use think\exception\ValidateException;
  4. use app\model\Agreement;
  5. class AgreementController extends Base
  6. {
  7. public function index()
  8. {
  9. $code = input('post.code', '', 'serach_in');
  10. $data = Agreement::where(['weid' => weid(), 'code' => $code])
  11. ->order('id desc')
  12. ->find();
  13. if (!empty($data)) {
  14. $data = $data->toArray();
  15. }
  16. return $this->json(['data' => $data]);
  17. }
  18. }