ManyOrder.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 ManyOrder extends AuthController
  31. {
  32. /**
  33. * @return mixed
  34. */
  35. public function index($uid = '', $status = '')
  36. {
  37. $list = \app\admin\model\many\Many::select();
  38. $this->assign([
  39. 'year' => get_month(),
  40. 'auction'=> $list,
  41. 'uid' => empty($uid)?0:$uid,
  42. 'status' => empty($status)?0:$status
  43. ]);
  44. return $this->fetch();
  45. }
  46. public function list()
  47. {
  48. $where = Util::getMore([
  49. ['status', ''],
  50. ['page', 1],
  51. ['limit', 20],
  52. ['stage', ''],
  53. ['order_id', ''],
  54. ['excel', 0],
  55. ['data', ''],
  56. ['many_id',''],
  57. ['name', ''],
  58. ['type', ''],
  59. ['uid']
  60. ]);
  61. return Json::successlayui(\app\admin\model\many\ManyOrder::list($where));
  62. }
  63. /**
  64. * 删除
  65. * @param $id
  66. * @return void
  67. * @throws \Exception
  68. */
  69. public function delete($id)
  70. {
  71. if (!$id) Json::fail('删除失败');
  72. $model = new \app\admin\model\many\ManyOrder();
  73. $res = $model->where('id', $id)->delete();
  74. if ($res){
  75. return Json::success('删除成功!');
  76. }else{
  77. return Json::fail($model->getErrorInfo());
  78. }
  79. }
  80. }