ManyDiscipline.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/11/11
  6. */
  7. namespace app\admin\controller\many;
  8. use app\admin\controller\AuthController;
  9. use crmeb\repositories\OrderRepository;
  10. use crmeb\repositories\ShortLetterRepositories;
  11. use crmeb\services\{ExpressService,
  12. JsonService,
  13. JsonService as Json,
  14. MiniProgramService,
  15. WechatService,
  16. FormBuilder as Form,
  17. CacheService,
  18. UtilService as Util};
  19. use app\admin\model\ump\StorePink;
  20. use crmeb\basic\BaseModel;
  21. use think\facade\Route as Url;
  22. use crmeb\services\YLYService;
  23. use think\facade\Log;
  24. use think\facade\Validate;
  25. /**
  26. * 订单管理控制器 同一个订单表放在一个控制器
  27. * Class StoreOrder
  28. * @package app\admin\controller\store
  29. */
  30. class ManyDiscipline extends AuthController
  31. {
  32. /**
  33. * @return mixed
  34. */
  35. public function index()
  36. {
  37. $list = \app\admin\model\many\Many::select();
  38. $this->assign([
  39. 'year' => get_month(),
  40. 'auction'=> $list,
  41. ]);
  42. return $this->fetch();
  43. }
  44. public function list()
  45. {
  46. $where = Util::getMore([
  47. ['status', ''],
  48. ['page', 1],
  49. ['limit', 20],
  50. ['stage', ''],
  51. ['order_id', ''],
  52. ['excel', 0],
  53. ['data', ''],
  54. ['many_id',''],
  55. ['name', '']
  56. ]);
  57. return Json::successlayui(\app\admin\model\many\ManyDiscipline::list($where));
  58. }
  59. /**
  60. * 删除
  61. * @param $id
  62. * @return void
  63. * @throws \Exception
  64. */
  65. public function delete($id)
  66. {
  67. if (!$id) Json::fail('删除失败');
  68. $model = new \app\admin\model\many\ManyDiscipline();
  69. $res = $model->where('id', $id)->delete();
  70. if ($res){
  71. return Json::success('删除成功!');
  72. }else{
  73. return Json::fail($model->getErrorInfo());
  74. }
  75. }
  76. }