// +---------------------------------------------------------------------- namespace app\controller\admin\v1\order; use app\common\controller\Order; use app\controller\admin\AuthController; use app\services\order\{ StoreOrderServices }; use think\facade\App; /** * 订单管理 * Class StoreOrder * @package app\controller\admin\v1\order */ class StoreOrder extends AuthController { use Order; /** * StoreOrder constructor. * @param App $app * @param StoreOrderServices $service */ public function __construct(App $app, StoreOrderServices $service) { parent::__construct($app); $this->services = $service; } /** * 易联云打印机打印 * @param $id * @return mixed */ public function order_print($id) { if (!$id) return app('json')->fail('缺少参数'); $order = $this->services->get($id); if (!$order) { return app('json')->fail('订单没有查到,无法打印!'); } $res = $this->services->orderPrint((int)$id, 0, 0); if ($res) { return app('json')->success('打印成功'); } else { return app('json')->fail('打印失败'); } } }