OperatingcityIncomelog.php 485 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class OperatingcityIncomelog extends Model
  5. {
  6. protected $connection = 'mysql';
  7. protected $pk = 'id';
  8. protected $name = 'operatingcity_incomelog';
  9. public static function getorderIncome($order_id, $areatype)
  10. {
  11. $res = self::where('order_id', $order_id)->where('areatype', $areatype)->find();
  12. if (!empty($res)) {
  13. return $res->income;
  14. } else {
  15. return 0;
  16. }
  17. }
  18. }