45 lines
1.5 KiB
PHP
45 lines
1.5 KiB
PHP
<?php
|
|
namespace app\api\controller\v1;
|
|
|
|
use app\api\model\BulkBuy as BulkBuyModel;
|
|
use app\api\validate\BulkBuy as BulkBuyValidate;
|
|
|
|
/**
|
|
* 大批量采购类
|
|
* Class BulkBuy
|
|
* @package app\api\controller
|
|
*/
|
|
class BulkBuy extends Base
|
|
{
|
|
public function initialize()
|
|
{
|
|
parent::initialize();
|
|
$this->model = new BulkBuyModel();
|
|
$this->validate = new BulkBuyValidate();
|
|
}
|
|
|
|
/**
|
|
* 列表
|
|
* @return \think\response\Json
|
|
*/
|
|
public function index()
|
|
{
|
|
$inputData = $this->request->param();
|
|
$inputData['platform_id'] = $this->platformId;
|
|
if (isset($inputData['language_id']) && $inputData['language_id'] != 0 && $inputData['language_id'] != '') {
|
|
$this->focus['site_id'] = $inputData['site_id'] = $inputData['language_id'];
|
|
unset($inputData['language_id']);
|
|
}
|
|
if (!$this->commonValidate(__FUNCTION__,$inputData)) {
|
|
return $this->msg(-1,$this->validate->getError());
|
|
}
|
|
$this->orderby['create_time'] = 'desc';
|
|
$result = $this->model->getAllList($inputData,$this->simple,$this->focus,$this->orderby,$this->field);
|
|
foreach ($result['page'] as $key => $item) {
|
|
$result['page'][$key]['area_name'] = $this->model->getAreaNameById(substr($item['area_id'],0,2)).$this->model->getAreaNameById($item['area_id']);
|
|
$result['page'][$key]['delivery_time'] = date('Y-m-d',$item['delivery_time']);
|
|
}
|
|
return $this->msg(200,'获取列表成功',$result);
|
|
}
|
|
}
|