PlanRecord.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace app\admin\controller\wechat;
  3. use app\common\controller\Backend;
  4. use app\admin\model\WechatResponse;
  5. /**
  6. * 扣款服务签约列表
  7. *
  8. * @icon fa fa-circle-o
  9. */
  10. class PlanRecord extends Backend
  11. {
  12. protected $model = null;
  13. // protected $noNeedRight = ['check_text_unique'];
  14. public function _initialize()
  15. {
  16. parent::_initialize();
  17. $this->model = model('WechatPlanRecord');
  18. }
  19. /**
  20. * 编辑
  21. */
  22. public function edit($ids = null)
  23. {
  24. $row = $this->model->get(['id' => $ids]);
  25. if (!$row) {
  26. $this->error(__('No Results were found'));
  27. }
  28. if ($this->request->isPost()) {
  29. $params = $this->request->post("row/a");
  30. if ($params) {
  31. $row->save($params);
  32. $this->success();
  33. }
  34. $this->error();
  35. }
  36. $this->view->assign("row", $row);
  37. return $this->view->fetch();
  38. }
  39. //
  40. // /**
  41. // * 判断价格是否唯一
  42. // * @internal
  43. // */
  44. // public function check_text_unique()
  45. // {
  46. // $row = $this->request->post("row/a");
  47. // $except = $this->request->post("except");
  48. // $text = isset($row['price']) ? $row['price'] : '';
  49. // if ($this->model->where('price', $text)->where(function ($query) use ($except) {
  50. // if ($except) {
  51. // $query->where('price', '<>', $except);
  52. // }
  53. // })->count() == 0) {
  54. // $this->success();
  55. // } else {
  56. // $this->error(__('Text already exists'));
  57. // }
  58. // }
  59. }