123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- namespace Scm_servicer\Lib;
- use Dever;
- class In
- {
- # 获取订单信息
- public function info($id)
- {
- Dever::load('manage/auth.init');
- $info = Dever::db('scm_servicer/in_order')->find($id);
- $string = '';
- $string = $info['order_num'];
- $servicer = Dever::db('scm_servicer/info')->one($info['servicer_id']);
- $string .= '<br />' . $servicer['name'];
- $store = Dever::db('scm_servicer/store')->one($info['servicer_store_id']);
- $string .= '.' . $store['name'];
- $string .= '<br />' . $info['info'];
- return $string;
- }
- # 查看详情
- public function show_api()
- {
- $id = Dever::input('id');
- $config = Dever::db('scm_servicer/in_order')->config['set'];
- $info = Dever::db('scm_servicer/in_order')->one($id);
- $status = Dever::status($config['status'], $info['status']);
- $member = Dever::db('scm_servicer/info')->one($info['servicer_id']);
- $store = Dever::db('scm_servicer/store')->one($info['servicer_store_id']);
- $supplier = Dever::db('scm_supplier/info')->one($info['supplier_id']);
- $cdate = date('Y-m-d H:i', $info['cdate']);
- $result = array();
- $result[$info['order_num']] = array
- (
- 'type' => 'info',
- 'content' => array
- (
- array
- (
- array('配送商', $member['name']),
- array('仓库', $store['name']),
- array('供应商', $supplier['name']),
- ),
- array
- (
- array('订单状态', $status),
- array('订单备注', $info['info']),
- ),
- ),
- );
- $table = array();
- $table['head'] = array('名称', '单价', '数量', '状态');
- $table['body'] = array();
- $data = Dever::db('scm_servicer/in_order_goods')->select(array('order_id' => $id));
- if ($data) {
- $status = Dever::db('scm_servicer/in_order_goods')->config['status'];
- foreach ($data as $k => $v) {
- $goods_info = Dever::load('scm_product/lib/info')->getBaseInfo($v['goods_id'], $v['sku_id']);
- $status_name = Dever::status($status, $v['status']);
- $table['body'][$k][] = $goods_info['name'];
- $table['body'][$k][] = $v['cash'];
- $table['body'][$k][] = $v['num'];
- $table['body'][$k][] = $status_name;
- }
- }
- $body[''] = array
- (
- 'type' => 'table',
- 'content' => $table,
- );
- $head = array
- (
- 'name' => '基本信息',
- 'btn' => '',
- );
- $html = Dever::show($head, $result);
- return $html;
- }
- }
|