76 lines
2.1 KiB
PHP
76 lines
2.1 KiB
PHP
|
|
<?php
|
||
|
|
namespace app\admin\controller\procurement;
|
||
|
|
|
||
|
|
use app\common\basics\AdminBase;
|
||
|
|
use app\admin\logic\procurement\ProcurementLogic;
|
||
|
|
use app\common\model\procurement\Mprocurement;
|
||
|
|
use app\common\server\JsonServer;
|
||
|
|
use app\common\enum\ClientEnum;
|
||
|
|
|
||
|
|
class Procurement extends AdminBase
|
||
|
|
{
|
||
|
|
public function lists(){
|
||
|
|
if ($this->request->isAjax()) {
|
||
|
|
$get = $this->request->get();
|
||
|
|
return JsonServer::success('', ProcurementLogic::lists($get));
|
||
|
|
}
|
||
|
|
|
||
|
|
return view('', [
|
||
|
|
'client_list' => ClientEnum::getClient(true)
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
public function examine(){
|
||
|
|
$id = $this->request->post('id');
|
||
|
|
$examine = $this->request->post('examine');
|
||
|
|
$data['u_examine_state'] = $examine;
|
||
|
|
$data['u_update'] = date("Y-m-d H:i:s");
|
||
|
|
$result = Mprocurement::where('u_id',$id)->update($data);
|
||
|
|
if($examine == 1){
|
||
|
|
$arr = [
|
||
|
|
'code' => 1,
|
||
|
|
'msg' => '审核通过'
|
||
|
|
];
|
||
|
|
}else{
|
||
|
|
$arr = [
|
||
|
|
'code' => 1,
|
||
|
|
'msg' => '审核拒绝'
|
||
|
|
];
|
||
|
|
}
|
||
|
|
return json($arr);
|
||
|
|
}
|
||
|
|
public function examineWprice(){
|
||
|
|
$id = $this->request->post('id');
|
||
|
|
$examine = $this->request->post('examine');
|
||
|
|
$data['wholesale_state'] = $examine;
|
||
|
|
$data['u_update'] = date("Y-m-d H:i:s");
|
||
|
|
$result = Mprocurement::where('u_id',$id)->update($data);
|
||
|
|
if($examine == 2){
|
||
|
|
$arr = [
|
||
|
|
'code' => 1,
|
||
|
|
'msg' => '审核通过'
|
||
|
|
];
|
||
|
|
}else{
|
||
|
|
$arr = [
|
||
|
|
'code' => 1,
|
||
|
|
'msg' => '审核拒绝'
|
||
|
|
];
|
||
|
|
}
|
||
|
|
return json($arr);
|
||
|
|
}
|
||
|
|
public function info(){
|
||
|
|
$id = $this->request->get('id', '', 'intval');
|
||
|
|
$detail = ProcurementLogic::getInfo($id);
|
||
|
|
return view('', [
|
||
|
|
'detail' => $detail
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
public function wprice(){
|
||
|
|
$id = $this->request->get('id', '', 'intval');
|
||
|
|
$detail = ProcurementLogic::getInfo($id);
|
||
|
|
return view('wprice', [
|
||
|
|
'detail' => $detail
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|