dataLists(new CashierclassLists()); } /** * @notes 添加零售订单 * @return \think\response\Json * @author likeadmin * @date 2024/04/24 09:57 */ public function add() { $params = (new CashierclassValidate())->post()->goCheck('add'); $result = CashierclassLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(CashierclassLogic::getError()); } /** * @notes 编辑零售订单 * @return \think\response\Json * @author likeadmin * @date 2024/04/24 09:57 */ public function edit() { $params = (new CashierclassValidate())->post()->goCheck('edit'); $result = CashierclassLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(CashierclassLogic::getError()); } /** * @notes 审核零售订单 * @return \think\response\Json * @author likeadmin * @date 2024/04/24 09:57 */ public function auditing() { $params = (new CashierclassValidate())->post()->goCheck('auditing'); $result = CashierclassLogic::auditing($params, $this->adminId); if (true === $result) { return $this->success('审核成功', [], 1, 1); } return $this->fail(CashierclassLogic::getError()); } /** * @notes 删除零售订单 * @return \think\response\Json * @author likeadmin * @date 2024/04/24 09:57 */ public function delete() { $params = (new CashierclassValidate())->post()->goCheck('delete'); CashierclassLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取零售订单详情 * @return \think\response\Json * @author likeadmin * @date 2024/04/24 09:57 */ public function detail() { $params =$this->request->get(); $result = CashierclassLogic::detail($params); return $this->data($result); } /** * @notes 设置打印 * @return \think\response\Json * @author likeadmin * @date 2024/04/24 09:57 */ public function set_print() { $id = $this->request->get('id'); if ($id) { $res = Cashierclass::where('id', $id)->update(['is_print' => 1]); if ($res) { return $this->success('设置成功', [], 1, 1); } } return $this->success('设置失败'); } /** * @notes 打印小票 * @return \think\response\Json */ public function prints() { $id = $this->request->get('id'); if (!$id) { return $this->fail('参数错误'); } Redis::send('push-platform-print', ['order_id' => $id]); return $this->success('正在打印中'); } }