Need Help! Please.
public static function generateKode_Urut() {
$_d = date("ymd");
$_left = $_d;
$_first = "0001";
$_len = strlen($_left);
$no = $_left . $_first;
$last_po = DocumentServices::find(
array(
"select" => "id",
"condition" => "left(id, " . $_len . ") = :_left",
"params" => array(":_left" => $_left),
"order" => "id DESC"
));
if ($last_po != null) {
$_no = substr($last_po->id, $_len);
$_no++;
$_no = substr("0000", strlen($_no)) . $_no;
$no = $_left . $_no;
}
return $no;
}
i got this error
Getting unknown property: yii\db\ActiveQuery::id
line code error
$_no = substr($last_po->id, $_len);