Ejemplo n.º 1
0
 public function cauhoiRevenueAction()
 {
     $month = $this->request->get("month", null, date("m"));
     $year = $this->request->get("year", null, date("Y"));
     $user_obj = new \HaiQuan\Backend\Models\CtgTuVan();
     $user = $user_obj->getStatistic($month, $year)->toArray();
     $user_chart = \library\Util::mergeStatistic($user, $month, $year);
     $this->view->data = \library\Util::createStatisticData($user_chart);
 }
Ejemplo n.º 2
0
 public function editAction()
 {
     $data_edit = $this->request->getPost("data", null, false);
     $response = array("status" => 0, "message" => "Không Thành Công");
     $user_obj = new \HaiQuan\Backend\Models\CtgTuVan();
     if (!empty($data_edit)) {
         if (isset($data_edit["ch_id"]) && !empty($data_edit["ch_id"])) {
             //                if ($data_edit["ch_status"] == 0) {
             $user_obj->updateByID($data_edit, $data_edit["ch_id"]);
             $data_traloi = array('tl_status' => $data_edit['ch_status']);
             $data_edit["tl_ch_id"] = $data_edit["ch_id"];
             $tuvan_traloi_model = new \HaiQuan\Backend\Models\CtgTuVanTraLoi();
             $check_traloi = $tuvan_traloi_model::find(array("tl_ch_id = '{$data_edit["tl_ch_id"]}'"));
             if (!empty($check_traloi) && $data_edit["ch_status"] == 0) {
                 $tuvan_traloi_model->updateByID($data_traloi, $data_edit["tl_ch_id"]);
             }
             $response = array("status" => 1, "message" => "Thành Công");
             //                }
         }
     }
     echo json_encode($response);
     exit;
 }