TodoConvey.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\App;
  6. use think\Db;
  7. use think\exception\Handle;
  8. class TodoConvey extends Base
  9. {
  10. public function __construct(App $app = null) {
  11. parent::__construct($app);
  12. $this->model = new \app\common\model\TodoConvey();
  13. }
  14. // 扫码
  15. public function sweepCode(){
  16. $data = [
  17. 'code' =>input('code'),
  18. 'isStart' => input('isStart'),
  19. 'orgId' =>$this->orgId,
  20. 'todoId' => input('todoId'),
  21. 'content' => input('content'),
  22. 'img' => input('img'),
  23. 'sample' => '',
  24. 'num'=>input('num'),
  25. ];
  26. $ret = $this->model->sweepCode($data,$this->userId);
  27. if(!$ret){
  28. HelpHander::error($this->model->getError());
  29. }
  30. HelpHander::success([],'操作成功');
  31. }
  32. // 保存签名
  33. public function saveSign(){
  34. $type = input('type',1); // 1=始发 2=目的
  35. $img = input('img','');
  36. $todoId = input('todoId/d',0);
  37. if(!$img){
  38. HelpHander::error('未上传签名');
  39. }
  40. $ret = $this->model->saveSign($todoId,$type,$img,$this->userId);
  41. if(!$ret){
  42. HelpHander::error($this->model->getError());
  43. }
  44. HelpHander::success([],'操作成功');
  45. }
  46. }