企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
###订单的签收 **位置:** Common\Lib\FlowLib.class.php **参数:** * @param $id int 订单ID * @param $type int 订单类型 * @return array 签收提示信息 **调用:** * $flow = new FlowLib(); * $order_arr = $flow->take($id, $type); **完整代码:** ~~~ /** * 收货单签收 * @param $id int 订单ID * @param $type int 订单类型 * @return array 签收提示信息 * whz 2018-02-06 * */ public function take($id, $type) { M()->startTrans(); //1、查询收货的门店(签收需要改变商品位置) $store_id = M('wms_flow') ->field('receive_id') ->where(array('id' => $id)) ->find(); if (count($store_id) == 0) { return array('success'=>false, 'code'=>201, 'msg'=>'订单信息查询失败!'); } //2、更改订单状态为:6、已签收 $res = M('wms_flow') ->where(array('id' => $id)) ->save(array('status' => 6)); if ($res === false) { M()->rollback(); return array('success'=>false, 'code'=>201, 'msg'=>'收货单状态改变失败!'); } //3、签收成功记录日志 $add_log['description'] = '订单签收成功!'; $add_log['order_id'] = $id; $add_log['type'] = $type; $logadd = $this->addLog($add_log); if (!$logadd) { M()->rollback(); return array('success' => false,'code' => 201 ,'msg' => '日志记录添加失败!'); } M()->commit(); return array('success' => true,'code' => 200 ,'msg' => '签收成功!'); } ~~~