1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
<?php defined('BASEPATH') or exit('No direct script access allowed'); use Illuminate\Database\Capsule\Manager as DB;
class Scoring_item_model extends BaseModel { public function __construct() { $this->table = strtolower(substr(__CLASS__, 0, -strlen('_model'))); parent::$sort_field = false; }
public static function get_data_by_application_id($application_id) { $application = Application_model::get_certain($application_id); $sql = "SELECT * FROM scoring_item AS si INNER JOIN (SELECT scoring_item_id FROM category_scoring_item WHERE `deleted` = 0 AND `status` = 1 AND category_id = '{$application['category_id']}') AS csi ON si.`id` = csi.`scoring_item_id` WHERE `deleted` = 0 AND `status` = 1 "; return json_decode(json_encode(DB::select($sql)), true); } }
|