口腔客户管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SmsLog.php 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. namespace app\admin\controller;
  3. use app\BaseController;
  4. class SmsLog extends BaseController
  5. {
  6. protected $noNeedLogin = [''];
  7. protected $noSize = ['*'];
  8. protected $noSecure = [//格式:'请求方式' => ['请求方法' => ['字段1','字段2'],],
  9. // 'post' => ['add' => ['data']]
  10. ];
  11. // public function read()
  12. // {
  13. // try {
  14. // $SmsLog_model = new \app\admin\model\SmsLog();
  15. // $result = $SmsLog_model->read($_GET);
  16. // tojson(200, '请求成功', $result);
  17. // } catch (\Exception $e) {
  18. // tojson(10000, $e->getMessage());
  19. // } catch (\Throwable $e) {
  20. // tojson(10000, $e->getMessage());
  21. // }
  22. // }
  23. public function getAll()
  24. {
  25. try {
  26. $SmsLog_model = new \app\admin\model\SmsLog();
  27. $result = $SmsLog_model->getAll($_GET, $this->request->page, $this->request->pageSize);
  28. tojson(200, '请求成功', $result);
  29. } catch (\Exception $e) {
  30. tojson(10000, $e->getMessage());
  31. } catch (\Throwable $e) {
  32. tojson(10000, $e->getMessage());
  33. }
  34. }
  35. //重发
  36. public function save()
  37. {
  38. try {
  39. $SmsLog_model = new \app\admin\model\SmsLog();
  40. $check = $SmsLog_model->where($SmsLog_model->getPk(), $_POST[$SmsLog_model->getPk()])->find();
  41. if (!$check) {
  42. tojson(10000, '记录不存在');
  43. }
  44. $_POST = $check;
  45. unset($_POST['id']);
  46. $result = $SmsLog_model->save($_POST);
  47. if ($result) {
  48. tojson(200, '添加成功');
  49. } else {
  50. tojson(10000, '添加失败');
  51. }
  52. } catch (\Exception $e) {
  53. tojson(10000, $e->getMessage());
  54. } catch (\Throwable $e) {
  55. tojson(10000, $e->getMessage());
  56. }
  57. }
  58. // public function update()
  59. // {
  60. // try {
  61. // $SmsLog_model = new \app\admin\model\SmsLog();
  62. // $check = $SmsLog_model->where($SmsLog_model->getPk(), $this->param[$SmsLog_model->getPk()])->value($SmsLog_model->getPk());
  63. // if (!$check) {
  64. // tojson(10000, '记录不存在');
  65. // }
  66. // $result = $SmsLog_model->where([$SmsLog_model->getPk() => $this->param[$SmsLog_model->getPk()]])->update($this->param);
  67. // if ($result) {
  68. // tojson(200, '修改成功');
  69. // } else {
  70. // tojson(10000, '修改失败');
  71. // }
  72. // } catch (\Exception $e) {
  73. // tojson(10000, $e->getMessage());
  74. // } catch (\Throwable $e) {
  75. // tojson(10000, $e->getMessage());
  76. // }
  77. // }
  78. // public function delete()
  79. // {
  80. // try {
  81. // $SmsLog_model = new \app\admin\model\SmsLog();
  82. // $check = $SmsLog_model->where($SmsLog_model->getPk(), $this->param[$SmsLog_model->getPk()])->value($SmsLog_model->getPk());
  83. // if (!$check) {
  84. // tojson(10000, '记录不存在');
  85. // }
  86. // $result = $SmsLog_model->where($SmsLog_model->getPk(), $this->param[$SmsLog_model->getPk()])->delete();
  87. // if ($result) {
  88. // tojson(200, '删除成功');
  89. // } else {
  90. // tojson(10000, '删除失败');
  91. // }
  92. // } catch (\Exception $e) {
  93. // tojson(10000, $e->getMessage());
  94. // } catch (\Throwable $e) {
  95. // tojson(10000, $e->getMessage());
  96. // }
  97. // }
  98. }