DailyRecord.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 DailyRecord extends Base
  9. {
  10. public function __construct(App $app = null) {
  11. parent::__construct($app);
  12. $this->model = new \app\common\model\DailyRecord();
  13. }
  14. public function queryDailyRecordlist(){
  15. $page =input('page',1);
  16. $size =input('size',10);
  17. $dailyId =input('dailyId/d',0);
  18. $type =input('type/d',0);
  19. $ret=$this->model->dailyRecordlist($page,$size,$this->orgId,$dailyId,$this->userId,$type);
  20. HelpHander::success($ret);
  21. }
  22. public function add(){
  23. $jsonArray = [
  24. 'dailyId'=>input('dailyId',0),
  25. 'images'=>input('images'),
  26. 'content'=>input('content'),
  27. 'userId'=>$this->userId,
  28. 'orgId'=>$this->orgId,
  29. 'checkJson'=>input('checkJson'),
  30. 'taskId'=>input('taskId'),
  31. ];
  32. $ret=$this->model->addSave($jsonArray);
  33. if($ret){
  34. HelpHander::success('添加成功');
  35. }else{
  36. HelpHander::error($this->model->getError());
  37. }
  38. }
  39. public function queryDailyDetails(){
  40. $dailyRecordId =input('dailyRecordId/d',0);
  41. $ret=$this->model->dailyRecordDetails($dailyRecordId,$this->userId);
  42. if($ret){
  43. HelpHander::success($ret);
  44. }else{
  45. HelpHander::error('暂无数据');
  46. }
  47. }
  48. }