0
0

GreenAddr.php 858 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\Db;
  6. class GreenAddr extends Base
  7. {
  8. public function sweepCode(){
  9. $code = input('code','','trim');
  10. $taskId = input('taskId/d',0);
  11. $greenAddrId = input('greenAddrId/d',0);
  12. $ret = model('GreenAddr')->sweepCode($code,$this->orgId,$this->userId,$taskId,$greenAddrId);
  13. if($ret){
  14. HelpHander::success($ret);
  15. }else{
  16. HelpHander::error(model('GreenAddr')->getError());
  17. }
  18. }
  19. public function getAddrInfo(){
  20. $id = input('id',0);
  21. $info = Db::name('green_addr')->field('id,title,content,img')->where('id',$id)->find();
  22. if($info){
  23. HelpHander::success($info);
  24. }else{
  25. HelpHander::error('参数错误');
  26. }
  27. }
  28. }