企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
### 获取订单的状态 **位置:** Common\Common\function.php **参数:** * @param int $status 订单状态 * @param int $type 是否HTML样式 默认1是,2否 **调用:** > Controller 控制器调用: > get_order_status ($status) > View 模版调用: > {$status|get_order_status} **完整代码:** ~~~ /** * 获取订单状态 * whz 2019-01-02 * * @param int $status 订单状态 * @param int $type 是否HTML样式 默认1是,2否 * * @return string */ function get_order_status ($status, $type = 1) { switch ($status) { case 1: echo $type == 1 ? '<span class="label label-danger">待付款</span>' : '待付款'; break; case 2: echo $type == 1 ? '<span class="label label-info">待审核</span>' : '待审核'; break; case 3: echo $type == 1 ? '<span class="label label-info">待发货</span>' : '待发货'; break; case 4: echo $type == 1 ? '<span class="label label-success">销售</span>' : '销售'; break; case 6: echo $type == 1 ? '<span class="label label-default">取消</span>' : '取消'; break; case 7: echo $type == 1 ? '<span class="label label-warning">已关闭</span>' : '已关闭'; break; case 8: echo $type == 1 ? '<span class="label label-info">已退货</span>' : '已退货'; break; case 9: echo $type == 1 ? '<span class="label label-info">已换货</span>' : '已换货'; break; case 10: echo $type == 1 ? '<span class="label label-danger">待退货</span>' : '待退货'; echo ''; break; case 11: echo $type == 1 ? '<span class="label label-warning">待退款</span>' : '待退款'; break; case 12: echo $type == 1 ? '<span class="label label-danger">换货待发货</span>' : '换货待发货'; break; case 13: echo $type == 1 ? '<span class="label label-success">换货</span>' : '换货'; break; case 15: echo $type == 1 ? '<span class="label label-default">退货驳回</span>' : '退货驳回'; break; case 16: echo $type == 1 ? '<span class="label label-default">换货驳回</span>' : '换货驳回'; break; case 17: echo $type == 1 ? '<span class="label label-success">退货</span>' : '退货'; break; case 18: echo $type == 1 ? '<span class="label label-danger">待换货</span>' : '待换货'; break; default: echo $type == 1 ? '<span class="label label-default">未知数</span>' : '未知数'; } } ~~~