123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- declare (strict_types = 1);
- namespace app\store\controller\card;
- use app\common\model\UserVerify;
- use app\store\controller\Controller;
- use app\store\model\card\RiceCardOrder as RiceCardOrderModel;
- use app\store\model\card\RiceCardOrderRemark as RiceCardOrderRemarkModel;
- /**
- * 米卡订单管理控制器
- * Class RiceCardOrder
- * @package app\store\controller\card
- */
- class RiceCardOrder extends Controller
- {
- public function list()
- {
- $model = new RiceCardOrderModel;
- $list = $model->getList($this->request->param());
- return $this->renderSuccess(compact('list'));
- }
- /**
- * 读取身份证认证信息
- * @return array
- */
- public function verified(){
- $userId = $this->request->param('userId');
- $m = new UserVerify();
- $list = $m->getUserIdCard($userId);
- return $this->renderSuccess(compact('list'));
- }
- /**
- * 详情记录
- * @param int $id
- * @return array
- */
- public function detail(int $id)
- {
- $model = new RiceCardOrderModel;
- $detail = $model->detail(['id' => $id], ['user.avatar']);
- return $this->renderSuccess(compact('detail'));
- }
- /**
- * 订单备注列表
- */
- public function remarkList($id)
- {
- $model = new RiceCardOrderRemarkModel;
- $list = $model->getListByOrderId($id);
- return $this->renderSuccess(compact('list'));
- }
- /**
- * 新增订单备注
- */
- public function addRemark($orderId)
- {
- // 新增记录
- $model = new RiceCardOrderRemarkModel;
- $post = $this->postForm();
- if (empty($post['content'])) {
- return $this->renderError("备注内容不能为空");
- }
- $post['order_id'] = $orderId;
- $post['admin_id'] = $this->store['user']['store_user_id'];
- if ($model->add($post)) {
- return $this->renderSuccess('添加成功');
- }
- return $this->renderError($model->getError() ?: '添加失败');
- }
- }
|