init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
namespace Retail\Controller;
|
||||
|
||||
use Retail\Business\UnitLibrary;
|
||||
use Think\Controller;
|
||||
|
||||
//[1.7.90]
|
||||
|
||||
/**
|
||||
* 单位库
|
||||
* Class UnitLibraryController
|
||||
* [
|
||||
* getUnitList 获取单位库列表
|
||||
* addMerchantUnit 添加商户单位
|
||||
* addStoreUnit 添加门店单位
|
||||
* deleteMerchantUnit 删除商户单位
|
||||
* deleteStoreUnit 删除门店单位
|
||||
* ]
|
||||
* @package Retail\Controller
|
||||
*/
|
||||
class UnitLibraryController extends BaseController
|
||||
{
|
||||
/**
|
||||
* 商户管理单位库页面
|
||||
*/
|
||||
public function mer_index()
|
||||
{
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店管理单位库页面
|
||||
*/
|
||||
public function store_index()
|
||||
{
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单位库列表
|
||||
* @param name 单位名称
|
||||
* @param start_time 开始时间
|
||||
* @param end_time 结束时间
|
||||
* @param page 页码
|
||||
* @param limit 页长
|
||||
* @param type 1 商户 2 门店
|
||||
*/
|
||||
public function getUnitList()
|
||||
{
|
||||
$UnitLibrary = new UnitLibrary();
|
||||
|
||||
$param = I('post.');
|
||||
$param['merchant_id'] = $this->merchant_id;
|
||||
$param['store_id'] = $this->store_id;
|
||||
$result = $UnitLibrary->getUnitList($param);
|
||||
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户单位
|
||||
* @param name 单位名称
|
||||
*/
|
||||
public function addMerchantUnit()
|
||||
{
|
||||
$UnitLibrary = new UnitLibrary();
|
||||
$this->ajaxReturn($UnitLibrary->addUnit([
|
||||
'name' => I('post.name'),
|
||||
'type' => 1,
|
||||
'merchant_id' => $this->merchant_id,
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加门店单位
|
||||
*/
|
||||
public function addStoreUnit()
|
||||
{
|
||||
$UnitLibrary = new UnitLibrary();
|
||||
$this->ajaxReturn($UnitLibrary->addUnit([
|
||||
'name' => I('post.name'),
|
||||
'type' => 2,
|
||||
'merchant_id' => $this->merchant_id,
|
||||
'store_id' => $this->store_id,
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户删除单位
|
||||
*/
|
||||
public function deleteMerchantUnit()
|
||||
{
|
||||
$UnitLibrary = new UnitLibrary();
|
||||
$this->ajaxReturn($UnitLibrary->deleteUnit([
|
||||
'id' => I('post.id'),
|
||||
'type' => 1,
|
||||
'merchant_id' => $this->merchant_id,
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店删除单位
|
||||
*/
|
||||
public function deleteStoreUnit()
|
||||
{
|
||||
$UnitLibrary = new UnitLibrary();
|
||||
$this->ajaxReturn($UnitLibrary->deleteUnit([
|
||||
'id' => I('post.id'),
|
||||
'type' => 2,
|
||||
'merchant_id' => $this->merchant_id,
|
||||
'store_id' => $this->store_id,
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单位列表-供筛选
|
||||
*/
|
||||
public function getUnitSelect()
|
||||
{
|
||||
$UnitLibrary = new UnitLibrary();
|
||||
$this->ajaxReturn($UnitLibrary->getUnitSelect([
|
||||
'merchant_id' => $this->merchant_id,
|
||||
'store_id' => $this->store_id,
|
||||
'name' => I('post.name'),
|
||||
'type' => I('post.type'),
|
||||
]));
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户