<?php
namespace app\index\model;
use think\Model;
/**
 * 工人日工资记录表
 *
 * @author wj
 * @date 2025-02-17
 */
class daypricerecodemodel extends Model {
    protected $table = 't_dayprice_recode';

    public function insinfo($arr) {
        $this->allowField(true)->save($arr);
        return $this->id;

    }

    public function getList($where = [], $field = "*", $page = 1, $size = 10, $order = "id desc", $group = "", $row = false) {
        $sqlObj = $this->where($where);
        if ("count" != $field) {
            $sqlObj = $sqlObj->field($field)->order($order)->group($group)->page($page, $size);
            if ($row) {
                $data = $sqlObj->find();
            } else {
                $data = $sqlObj->select();
            }
        } else {
            $data = $sqlObj = $sqlObj->count();
        }
        return $data;
    }
}