...
|
...
|
@@ -11,6 +11,7 @@ use Exception; |
|
|
use think\exception\PDOException;
|
|
|
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
|
|
use think\exception\ValidateException;
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
*
|
...
|
...
|
@@ -48,22 +49,20 @@ class Product extends Backend |
|
|
$this->relationSearch = true;
|
|
|
//设置过滤方法
|
|
|
$this->request->filter(['strip_tags', 'trim']);
|
|
|
if ($this->request->isAjax())
|
|
|
{
|
|
|
if ($this->request->isAjax()) {
|
|
|
//如果发送的来源是Selectpage,则转发到Selectpage
|
|
|
if ($this->request->request('keyField'))
|
|
|
{
|
|
|
if ($this->request->request('keyField')) {
|
|
|
return $this->selectpage();
|
|
|
}
|
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
|
$total = $this->model
|
|
|
->with(['classa','classcon','logo'])
|
|
|
->with(['classa', 'classcon', 'logo'])
|
|
|
->where($where)
|
|
|
->order($sort, $order)
|
|
|
->count();
|
|
|
|
|
|
$list = $this->model
|
|
|
->with(['classa','classcon','logo'])
|
|
|
->with(['classa', 'classcon', 'logo'])
|
|
|
->where($where)
|
|
|
->order($sort, $order)
|
|
|
->limit($offset, $limit)
|
...
|
...
|
@@ -89,6 +88,7 @@ class Product extends Backend |
|
|
*/
|
|
|
public function import()
|
|
|
{
|
|
|
echo '1';
|
|
|
$file = $this->request->request('file');
|
|
|
if (!$file) {
|
|
|
$this->error(__('Parameter %s can not be empty', 'file'));
|
...
|
...
|
@@ -175,8 +175,6 @@ class Product extends Backend |
|
|
$row[$fieldArr[$k]] = $v;
|
|
|
}
|
|
|
}
|
|
|
dump($row);
|
|
|
die;
|
|
|
if ($row) {
|
|
|
$insert[] = $row;
|
|
|
}
|
...
|
...
|
|