多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
### 生成发货单号 **位置:** Common\Lib\OrderLib.class.php **参数:** * @param $type 1、门店发货;2、仓库发货 * @param $delivery_id 发货位置ID * @param $id 发货单ID **调用:** * 组件文件外调用 $my_order = new OrdersLib(); $delivery_no = $my_order->setDeliveryNo($type, $delivery_id, $id); **完整代码:** ~~~ /** * 生成发货单号 * $type 1、门店发货,2、仓库发货 * @param $delivery_id 门店ID * @param $id 发货单ID * @return 生成的发货单号 */ public function setDeliveryNo($type, $delivery_id, $id) { if ($type == 1) { $shops = M('shops')->field('shops_no')->where(array('id' => $delivery_id))->find(); }else{ $shops = M('storage')->field('no as shops_no')->where(array('id' => $delivery_id))->find(); } return $shops['shops_no'] . date('ymd', time()) . $id; } ~~~