购买软路由-支付
This commit is contained in:
@@ -9,10 +9,49 @@ use fastphp\base\Controller;
|
||||
class Product extends Controller
|
||||
{
|
||||
//获取产品列表
|
||||
public function getBuyerInfo() {
|
||||
$buyer_model = new BuyerModel();
|
||||
public function getList() {
|
||||
$product_model = new ProductModel();
|
||||
|
||||
$info = $buyer_model->getOne(['user_id'=>$this->userinfo['UserId']]);
|
||||
$list = $product_model->getList([],'*','id asc');
|
||||
$info = [
|
||||
'Code' => 10000,
|
||||
'TotalCount' => count($list),
|
||||
'Data' => $list
|
||||
];
|
||||
echo json_encode($info);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 修改状态
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
public function setStatus() {
|
||||
$data = json_decode(file_get_contents("php://input"),true);
|
||||
$product_model = new ProductModel();
|
||||
$product_model->updateOne(['id'=>$data['id']],['status'=>$data['status']]);
|
||||
|
||||
$info = [
|
||||
'Code' => 10000,
|
||||
];
|
||||
echo json_encode($info);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 修改产品信息
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
public function setInfo() {
|
||||
$data = json_decode(file_get_contents("php://input"),true);
|
||||
$product_model = new ProductModel();
|
||||
$update_data = $data;
|
||||
unset($update_data['id']);
|
||||
$product_model->updateOne(['id'=>$data['id']],$update_data);
|
||||
|
||||
$info = [
|
||||
'Code' => 10000,
|
||||
];
|
||||
echo json_encode($info);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user