🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
### 获取订单唯一码的状态 **位置:** Common\Common\function.php **参数:** * @param int $status 订单唯一码状态 * @param int $type 是否HTML样式 默认1是,2否 **调用:** > Controller 控制器调用: > get_item_status ($status) > View 模版调用: > {$status|get_item_status} **完整代码:** ~~~ /** * 获取订单唯一码状态 * whz 2019-01-25 * * @param int $status 订单唯一码状态 * @param int $type 是否HTML样式 默认1是,2否 * * @return string */ function get_item_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-success">销售</span>' : '销售'; break; case 3: echo $type == 1 ? '<span class="label label-success">已退货</span>' : '已退货'; break; case 4: echo $type == 1 ? '<span class="label label-success">已换货</span>' : '已换货'; break; case 5: echo $type == 1 ? '<span class="label label-danger">待退货</span>' : '待退货'; break; case 6: echo $type == 1 ? '<span class="label label-success">退货</span>' : '退货'; break; case 7: echo $type == 1 ? '<span class="label label-danger">换货待发货</span>' : '换货待发货'; break; case 8: echo $type == 1 ? '<span class="label label-success">换货销售</span>' : '换货销售'; break; case 9: echo $type == 1 ? '<span class="label label-warning">无法发货</span>' : '无法发货'; break; case 10: echo $type == 1 ? '<span class="label label-danger">待换货</span>' : '待换货'; echo ''; break; case 11: echo $type == 1 ? '<span class="label label-success">换货</span>' : '换货'; break; case 12: echo $type == 1 ? '<span class="label label-default">换货驳回</span>' : '换货驳回'; break; default: echo $type == 1 ? '<span class="label label-default">未知数</span>' : '未知数'; } } ~~~