新版订单消耗系统

MjOfflineImport.php 553B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use DB;
  5. class MjOfflineImport extends Model
  6. {
  7. protected $table = 'mj_offline_import';
  8. public $timestamps = false;
  9. protected static $unguarded = true;
  10. public static function delByCostId($id)
  11. {
  12. $info = OrderCost::select('task_id', 'month')
  13. ->where('id', $id)
  14. ->first();
  15. if(empty($info)){
  16. return false;
  17. }
  18. return self::where('task_id', $info->task_id)->where('month', $info->month)->update(['enable'=>0]);
  19. }
  20. }