27 lines
716 B
PHP
27 lines
716 B
PHP
<?php
|
|
|
|
namespace app\controller\admin\xm;
|
|
|
|
use app\BaseController;
|
|
use app\service\CurdService;
|
|
use think\response\Json;
|
|
|
|
class ProductController extends BaseController
|
|
{
|
|
public function page(): Json
|
|
{
|
|
try{
|
|
$model = \app\entity\XmProduct::withSearch([], [
|
|
'productName' => $this->request->get('productName/s', ''),
|
|
'productCode' => $this->request->get('productCode/s', ''),
|
|
])->append(['company']);
|
|
|
|
$paginate = CurdService::getPaginate($this->request, $model);
|
|
}catch (\Exception $e){
|
|
return $this->writeError($e->getMessage());
|
|
}
|
|
|
|
|
|
return $this->writeSuccess('success', $paginate);
|
|
}
|
|
} |