IntegralRecordApi.php 846 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\common\api;
  3. use app\common\api\DictApi;
  4. use app\admin\model\Enterprise;
  5. use think\facade\Db;
  6. use app\common\model\IntegralRecord;
  7. use app\common\api\IntegralState;
  8. /**
  9. * Description of IntegralRecordApi
  10. *
  11. * @author sgq
  12. */
  13. class IntegralRecordApi {
  14. public static function getOne($id) {
  15. return IntegralRecord::where("id", "=", $id)->find();
  16. }
  17. public static function getList() {
  18. }
  19. public static function checkIsEditable($id) {
  20. $info = self::getOne($id);
  21. if (!$info || !in_array($info["checkState"], [0, IntegralState::SAVE]))
  22. return false;
  23. return true;
  24. }
  25. static public function chkIsOwner($id, $uid) {
  26. $info = self::getOne($id);
  27. if ($info["enterprise_id"] != $uid)
  28. return null;
  29. return $info;
  30. }
  31. }