| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 | 
							- <?php
 
- namespace Scm_servicer\Lib;
 
- use Dever;
 
- class Manage
 
- {
 
-     public function __construct()
 
-     {
 
-         Dever::load('manage/auth.init');
 
-     }
 
-     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 = '(已禁用)';
 
-             	}
 
-             	$oper = '<a class="layui-btn" href="'.Dever::url('lib/set.home?role=servicer/store&id=' . $v['id'], 'scm_product').'">仓库明细</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 '暂无';
 
-         }
 
-     }
 
-     public function getGoods($id)
 
-     {
 
-         $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) {
 
-                 $status_name = Dever::status($status, $v['status']);
 
-                 $table['body'][$k][] = $v['goods'];
 
-                 $table['body'][$k][] = $v['cash'];
 
-                 $table['body'][$k][] = $v['num'];
 
-                 $table['body'][$k][] = $status_name;
 
-             }
 
-         }
 
-         $body[''] = array
 
-         (
 
-             'type' => 'table',
 
-             'content' => $table,
 
-         );
 
-         if ($table['body']) {
 
-             return Dever::show('', $body);
 
-         } else {
 
-             return '暂无';
 
-         }
 
-     }
 
- }
 
 
  |