Card.php 646 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\controller;
  3. use app\BaseController;
  4. use app\model\CardModel;
  5. use app\model\SettingModel;
  6. class Card extends BaseController
  7. {
  8. function index(): \think\response\Json
  9. {
  10. $apps = CardModel::where('status', 1)->select();
  11. return $this->success('ok', $apps);
  12. }
  13. function install_num(): \think\response\Json
  14. {
  15. $id = $this->request->post('id', 0);
  16. if ($id) {
  17. $find = CardModel::where("id", $id)->find();
  18. if ($find) {
  19. $find->install_num += 1;
  20. $find->save();
  21. }
  22. }
  23. return $this->success('ok');
  24. }
  25. }