offer fileupload and comments
This commit is contained in:
@@ -6,9 +6,8 @@
|
||||
* Time: 18:05
|
||||
*/
|
||||
|
||||
use \Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
|
||||
class Project extends Eloquent {
|
||||
class Project extends BaseModel {
|
||||
|
||||
protected $table = "projects";
|
||||
|
||||
@@ -16,4 +15,24 @@ class Project extends Eloquent {
|
||||
{
|
||||
return $this->hasMany( 'Offer' );
|
||||
}
|
||||
|
||||
public static function saveProject( $offerID, $offer )
|
||||
{
|
||||
$offer = (array) $offer;
|
||||
|
||||
$offer['startdate'] = date2mysql( $offer['startdate'] );
|
||||
$offer['accepteddate'] = date2mysql( $offer['accepteddate'] );
|
||||
$offer['rejectdate'] = date2mysql( $offer['rejectdate'] );
|
||||
|
||||
if ( $offerID == 0 )
|
||||
{
|
||||
$offer = Offer::create( $offer );
|
||||
}
|
||||
else
|
||||
{
|
||||
$offer = Offer::whereId( $offerID )->update( $offer );
|
||||
}
|
||||
|
||||
return $offer['id'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user