购买软路由-支付

This commit is contained in:
“wanyongkang”
2022-03-23 16:28:57 +08:00
parent aab0d282c1
commit 5661016d4f
3 changed files with 87 additions and 4 deletions

View File

@@ -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);
}
}