123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- namespace Scm_servicer\Lib;
- use Dever;
- class Manage
- {
- public function __construct()
- {
- Dever::load('manage/auth.init');
- }
- # 获取订单信息
- public function info($type = 'in', $id)
- {
- Dever::load('manage/auth.init');
- $info = Dever::db('scm_servicer/'.$type.'_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'];
- if (isset($info['supplier_id'])) {
- $supplier = Dever::db('scm_supplier/info')->one($info['supplier_id']);
- $string .= '<br />' . $supplier['name'];
- }
- $type = Dever::db('scm_servicer/'.$type.'_order_type')->one($info['type']);
- $string .= '<br />' . $type['name'];
- $string .= '<br />' . $info['info'];
- return $string;
- }
- # 查看详情
- public function show()
- {
- $type = Dever::input('type');
- return Dever::load('scm/lib/order')->show('scm_servicer/'.$type.'_order', 'scm_servicer/info', 'servicer_id', '配送商');
- }
- public function getStore($id)
- {
- $table = array();
- $table['head'] = array('仓库名称', '仓库编码', '操作');
- $table['body'] = array();
- $data = Dever::db('scm_servicer/store')->select(array('servicer_id' => $id));
- if ($data) {
- $status = Dever::db('scm_servicer/store')->config['status'];
- foreach ($data as $k => $v) {
- $status_name = '';
- if ($v['status'] == 2) {
- $status_name = '(已禁用)';
- }
- $url = Dever::url('project/database/update?project=scm_servicer&table=store&oper_save_table=info&set=1&where_id='.$v['id'], 'manage');
- $oper = '<a class="layui-btn" onclick="fastEdit($(this),\''.$url.'\',\'编辑仓库信息\', \'\')">编辑</a>';
- $url = Dever::url('project/database/list?project=scm_servicer&table=store_goods&oper_table=info&top_table1=info&search_option_servicer_store_id='.$v['id'], 'manage');
- $oper .= '<a class="layui-btn" href="'.$url.'">库存清单</a>';
- $table['body'][$k][] = $v['name'] . $status_name;
- $table['body'][$k][] = $v['code'];
- $table['body'][$k][] = $oper;
- }
- }
- $body[''] = array
- (
- 'type' => 'table',
- 'content' => $table,
- );
- if ($table['body']) {
- return Dever::show('', $body);
- } else {
- return '暂无';
- }
- }
- }
|