|
@@ -33,6 +33,7 @@ class JGEmploye extends MongoAr
|
|
|
public $desc;//备注
|
|
|
public $score = 0;//积分
|
|
|
public $degree = 1;//次数
|
|
|
+ public $ranking;
|
|
|
|
|
|
public static $work_type_options = array(
|
|
|
1 => array('name' => '钟点工'),
|
|
@@ -84,6 +85,27 @@ class JGEmploye extends MongoAr
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public function getSort($newRow)
|
|
|
+ {
|
|
|
+ if ($newRow['score'] == 0) {
|
|
|
+ return '暂无排名';
|
|
|
+ } else {
|
|
|
+ $criteria = new EMongoCriteria();
|
|
|
+ $criteria->sort('socre',EMongoCriteria::SORT_DESC);
|
|
|
+ $criteria->store_id('==',$newRow['store_id']);
|
|
|
+ $tmp = JGEmploye::model()->findAll($criteria);
|
|
|
+ $i = 1;
|
|
|
+ foreach ($tmp as $key => $value) {
|
|
|
+ if ($key == $newRow['id']) {
|
|
|
+ return $i;
|
|
|
+ } else {
|
|
|
+ $i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static function getStoreInfo() {
|
|
|
$data = array();
|
|
|
$criteria = new EMongoCriteria();
|
|
@@ -116,7 +138,6 @@ class JGEmploye extends MongoAr
|
|
|
//$newRow['work_type_str'] = self::$work_type_options[intval($newRow['work_type'])]['name'];
|
|
|
$newRow['skill'] = CommonFn::get_val_if_isset($row,'skill','');
|
|
|
//$newRow['skill_str'] = self::$skill_options[intval($newRow['skill'])]['name'];
|
|
|
-
|
|
|
$newRow['star'] = CommonFn::get_val_if_isset($row,'star','');
|
|
|
$newRow['degree'] = CommonFn::get_val_if_isset($row,'degree','');
|
|
|
$newRow['score'] = CommonFn::get_val_if_isset($row,'score','');
|
|
@@ -128,6 +149,7 @@ class JGEmploye extends MongoAr
|
|
|
$newRow['desc'] = CommonFn::get_val_if_isset($row,'desc','');
|
|
|
$newRow['work_time_part'] = CommonFn::get_val_if_isset($row,'work_time_part','');
|
|
|
$newRow['extra'] = CommonFn::get_val_if_isset($row,'work_time_part','');
|
|
|
+ $newRow['ranking'] = $this->getSort($newRow);
|
|
|
if (!empty($newRow['extra'])) {
|
|
|
$tmp = array();
|
|
|
$i = 0;
|