Merge pull request #229 from openclassify/vedatakd

create section block
This commit is contained in:
Fatih Alp 2020-01-14 10:59:52 +03:00 committed by GitHub
commit a15ec03e85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View File

@ -32,3 +32,5 @@
</div>
</div>
</div>
{{ addBlock('ad-detail/section',{'adv':adv})|raw }}

View File

@ -207,11 +207,16 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
}
}
// //UPDATE `default_advs_advs` SET `coor` = (PointFromText('POINT(41.085022 28.804754)')) WHERE `default_advs_advs`.`id` = 8
// //SELECT * FROM `default_advs_advs` WHERE ST_DISTANCE(ST_GeomFromText('POINT(41.0709052 28.829627)'), coor) < 20
if (!empty($param['dlong']) && !empty($param['dlat']) && !empty($param['distance'])) {
$query = $query->whereNotNull('coor');
$query = $query->whereRaw("ST_DISTANCE(ST_GeomFromText('POINT(" . $param['dlong'] . " " . $param['dlat'] . ")'), coor) < " . $param['distance']);
}
if ($isActiveDopings) {
if ($param == null) {
$DopingModel = new DopingModel();
@ -292,7 +297,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
$adv = $this->model
->where('advs_advs.id', $id)
->leftJoin('users_users as u1', 'advs_advs.created_by_id', '=', 'u1.id')
->select('advs_advs.*','u1.first_name as first_name', 'u1.last_name as last_name', 'u1.id as owner_id')
->select('advs_advs.*', 'u1.first_name as first_name', 'u1.last_name as last_name', 'u1.id as owner_id')
->inRandomOrder()
->first();

View File

@ -3,10 +3,11 @@
class EditAd
{
public function __construct($request,$settings)
public function __construct($request, $settings, $adv)
{
$this->request = $request;
$this->settings = $settings;
$this->adv = $adv;
}
public function getRequest()

View File

@ -625,7 +625,7 @@ class AdvsController extends PublicController
if ($adv->slug == "") {
$events->dispatch(new CreateAd($request->update_id, $settings));//Create Notify
} else {
$events->dispatch(new EditAd($request->update_id, $settings));//Update Notify
$events->dispatch(new EditAd($request->update_id, $settings, $adv));//Update Notify
}