0
0

TodoConvey.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. ];
  25. $ret = $this->model->sweepCode($data,$this->userId);
  26. if(!$ret){
  27. HelpHander::error($this->model->getError());
  28. }
  29. HelpHander::success([],'操作成功');
  30. }
  31. // 保存签名
  32. public function saveSign(){
  33. $type = input('type',1); // 1=始发 2=目的
  34. $img = input('img','');
  35. $todoId = input('todoId/d',0);
  36. if(!$img){
  37. HelpHander::error('未上传签名');
  38. }
  39. $ret = $this->model->saveSign($todoId,$type,$img,$this->userId);
  40. if(!$ret){
  41. HelpHander::error($this->model->getError());
  42. }
  43. HelpHander::success([],'操作成功');
  44. }
  45. }