|
@@ -5,6 +5,7 @@ namespace app\admin\controller;
|
|
|
use app\admin\logic\CompanyGoodLogic;
|
|
|
use app\BaseController;
|
|
|
use app\model\CommonModel;
|
|
|
+use app\model\GoodModel;
|
|
|
use think\exception\ValidateException;
|
|
|
use think\facade\Config;
|
|
|
use think\facade\Validate;
|
|
@@ -15,7 +16,7 @@ class CompanyGood extends BaseController
|
|
|
//列表
|
|
|
public function list()
|
|
|
{
|
|
|
- $param = $this->request->only(['group_id' => '', 'page' => 1, 'size' => 10, 'good_name' => '', 'good_code' => '', 'status' => ''], 'post');
|
|
|
+ $param = $this->request->only(['group_id' => '', 'page' => 1, 'size' => 10, 'good_name' => '', 'good_code' => '', 'status' => '', 'type' => ''], 'post');
|
|
|
|
|
|
$val = Validate::rule([
|
|
|
'group_id|分组id' => 'number|gt:0',
|
|
@@ -24,6 +25,7 @@ class CompanyGood extends BaseController
|
|
|
'good_name|商品名称' => 'number|elt:100',
|
|
|
'good_cood|商品编码' => 'number|elt:100',
|
|
|
'status|状态' => 'number|in:' . CommonModel::$status_normal . ',' . CommonModel::$status_disable,
|
|
|
+ 'type|商品类型' => 'number|in:' . GoodModel::$type_shopping . ',' . GoodModel::$type_exchange
|
|
|
]);
|
|
|
|
|
|
if (!$val->check($param)) throw new ValidateException($val->getError());
|