123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- namespace Scm_seller\Lib;
- use Dever;
- class Manage
- {
- public function __construct()
- {
- Dever::load('manage/auth.init');
- }
- # 获取订单信息
- public function info($type = 'in', $id)
- {
- $info = Dever::db('scm_seller/'.$type.'_order')->find($id);
- $string = '';
- $string = $info['order_num'];
- $seller = Dever::db('scm_seller/info')->one($info['seller_id']);
- $string .= '<br />' . $seller['name'];
- $shop = Dever::db('scm_seller/shop')->one($info['seller_shop_id']);
- $string .= '.' . $shop['name'];
- if (isset($info['supplier_id'])) {
- $supplier = Dever::db('scm_supplier/info')->one($info['supplier_id']);
- $string .= '<br />' . $supplier['name'];
- }
- if (isset($info['servicer_id'])) {
- $servicer = Dever::db('scm_servicer/info')->one($info['servicer_id']);
- $string .= '<br />' . $servicer['name'];
- if (isset($info['servicer_store_id'])) {
- $store = Dever::db('scm_servicer/store')->one($info['servicer_store_id']);
- $string .= '.' . $store['name'];
- }
- }
- if ($type == 'in' || $type == 'out') {
- $type = Dever::db('scm_seller/'.$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_seller/'.$type.'_order', 'scm_seller/info', 'seller_id', '经销商');
- }
- public function getShop($id)
- {
- $table = array();
- $table['head'] = array('门店名称', '门店编码', '操作');
- $table['body'] = array();
- $data = Dever::db('scm_seller/shop')->select(array('seller_id' => $id));
- if ($data) {
- $status = Dever::db('scm_seller/shop')->config['status'];
- foreach ($data as $k => $v) {
- $status_name = '';
- if ($v['status'] == 2) {
- $status_name = '(已禁用)';
- }
- $url = Dever::url('project/database/update?project=scm_seller&table=shop&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_seller&table=shop_goods&oper_table=info&search_option_seller_shop_id='.$v['id'], 'manage');
- $oper .= '<a class="layui-btn" href="'.$url.'">商品清单</a>';
- $url = Dever::url('lib/set_store.home?role=seller&table=shop', 'scm_servicer');
- $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 '暂无';
- }
- }
- }
|