| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace app\admin\controller\mall;
- use app\common\command\Tree;
- use app\common\controller\AdminController;
- use EasyAdmin\annotation\ControllerAnnotation;
- use EasyAdmin\annotation\NodeAnotation;
- use think\App;
- use think\facade\Db;
- /**
- * @ControllerAnnotation(title="express_delivery")
- */
- class ExpressDelivery extends AdminController
- {
- use \app\admin\traits\Curd;
- public function __construct (App $app)
- {
- parent::__construct($app);
- $this->model = new \app\common\model\ExpressDelivery();
- }
- public function add ()
- {
- if ($this->request->isAjax()) {
- $data = $this->request->post();
- return $this->model->saveExpress($data);
- }
- return $this->fetch();
- }
- public function edit ($id)
- {
- $data = $this->model->where(['id' => $id])->findOrEmpty()->toArray();
- $items = Db::name('express_shipping_method')->where(['template_id' => $data['id']])->select()->toArray();
- $this->assign('data', $data);
- $this->assign('items', $items);
- if ($this->request->isAjax()) {
- $data = $this->request->post();
- return $this->model->saveExpress($data);
- }
- return $this->fetch();
- }
- }
|