Variable.php 806 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\admin\controller\sms;
  3. use app\common\controller\Backend;
  4. use modules\sms\library\Helper;
  5. /**
  6. * 模板变量管理
  7. *
  8. */
  9. class Variable extends Backend
  10. {
  11. /**
  12. * Variable模型对象
  13. * @var \app\admin\model\sms\Variable
  14. */
  15. protected $model = null;
  16. protected $quickSearchField = ['title', 'name'];
  17. protected $defaultSortField = 'id,desc';
  18. protected $preExcludeFields = ['createtime', 'updatetime'];
  19. public function initialize()
  20. {
  21. parent::initialize();
  22. $this->model = new \app\admin\model\sms\Variable;
  23. }
  24. public function getVar($id)
  25. {
  26. $val = Helper::calcVar($id);
  27. if ($val) {
  28. $this->success('', $val);
  29. }
  30. $this->error('计算失败,请检查变量设置');
  31. }
  32. }